1

Using magento 2.2, in admin page. I want to add new product without using Attribute . So how to remove this block?

enter image description here

1

Override Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Attributes in your custom module, you can take reference from Magento 2 : Override Releted.php class file under Ui DataProvider folder

And replace below code

public function modifyMeta(array $meta)
{
    if (!$this->canAddAttributes()) {
        return $meta;
    }

    if (isset($meta[static::GROUP_CODE])) {
        $meta[static::GROUP_CODE]['arguments']['data']['config']['component'] =
            'Magento_Catalog/js/components/attributes-fieldset';
    }

    $meta = $this->customizeAddAttributeModal($meta);
    $meta = $this->customizeCreateAttributeModal($meta);
    $meta = $this->customizeAttributesGrid($meta);

    return $meta;
}

with

public function modifyMeta(array $meta)
{
    return $meta;
}

Also replace below code

public function modifyData(array $data)
{
    return $data;
}

with

public function modifyData(array $data)
{
    return null;
}
1

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.