Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Add ability to edit product attributes from Products grid

Notifications You must be signed in to change notification settings

DefaultValue/AkeneoInlineEditBundle

Repository files navigation

Scrutinizer Code Quality

AkeneoInlineEditBundle

AkeneoInlineEditBundle provides ability to edit product attributes from Products Grid.

Installation

Step 1: Install bundle with composer

php composer.phar require default-value/akeneo-inline-edit-bundle 2.0

Step 2: Enable the bundle

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new DefaultValue\Bundle\AkeneoInlineEditBundle\DefaultValueAkeneoInlineEditBundle(),
    );
}

Step 3: Add bundle routing to app/config/routing.yml

default_value_akeneo_inline_edit:
    resource: "@DefaultValueAkeneoInlineEditBundle/Resources/config/routing.yml"

Configuration

Datagrid

Set following properties in datagrid configuration:

  1. Set rowAction to false (to disable default row Action):
actions:
    edit:
        type:      navigate
        label:     Label
        icon:      icon-class
        link:      edit_link
        rowAction: false
  1. Add to properties configuration following options:
update_attribute_value:
    type: url
    route: default_value_inline_edit_update_attribute
    params:
        - id
        - dataLocale
        - scopeCode
  1. Set column property editable to true:
columns:
    name:
        label:         Name
        type:          product_value_field
        selector:      product_value_base
        editable:      true

Note: Editable columns should have the same name as attribute code. E.g. product has attribute name and no attribute title which comes with default grid configuration.

ACL

Action for updating attribute value has defined AclAncestor - default_value_inline_edit_update_value. So, you are able to configure the roles that have permission to edit product from Products Grid. More details about ACL and permissions configuration you can find in Akeneo documentation.

Limitation

Bundle supports following types of attributes:

  • Number
  • Text Area
  • Text
  • Price (only for USD currency)