4

I have created an eav attribute and modified the field inside edit product form, that was easy. But in products mass action (Update attributes) page, the field I have created, by eav Attribute and modified, doesn't apply, It gets the default eav attribute field type etc. How could I apply the modifier for that form?

public function modifyMeta(array $meta)
    {

    $fieldCode = 'material';

    $elementPath = $this->arrayManager->findPath($fieldCode, $meta, null, 'children');
    $containerPath = $this->arrayManager->findPath(static::CONTAINER_PREFIX . $fieldCode, $meta, null, 'children');

    if (!$elementPath) {
        return $meta;
    }

    $meta = $this->arrayManager->merge(
        $containerPath,
        $meta,
        [
            'children' => [
                $fieldCode => [
                    'arguments' => [
                        'data' => [
                            'config' => [
                                'formElement' => 'select',
                                'componentType' => 'field',
                                'component' => 'VENDOR/js/components/select',
                                'filterOptions' => false,
                                'chipsEnabled' => true,
                                'disableLabel' => true,
                                'levelsVisibility' => '0',
                                'elementTmpl' => 'ui/grid/filters/elements/ui-select',
                                'filterOptions' => true,
                                'dataType'  => 'string',
                                'multiple'  => true,
                                'showTree'  => true,
                                'options' => $this->getOptions(),
                                'config' => [
                                    'dataScope' => $fieldCode,
                                ],
                            ],
                        ],
                    ],
                ]
            ]
        ]
    );

    return $meta;
}

That's how I did in edit Product form, but It doesn't apply to mass actions update attributes form.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.