0

I have tried to override _processAttributeOptions() method from Magento\Eav\Model\ResourceModel\Entity\Attribute in my custom module. but the function does not override. Here is my code:

Namespace\Module_Name\etc\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Eav\Model\ResourceModel\Entity\Attribute" type="Namespace\Module_Name\Model\ResourceModel\Entity\Attribute" />
</config>

Namespace\Module_Name\Model\ResourceModel\Entity\Attribute

<?php

namespace Namespace\Module_Name\Model\ResourceModel\Entity;

class Attribute extends \Magento\Eav\Model\ResourceModel\Entity\Attribute
{
 protected function _processAttributeOptions($object, $option)
    {
             //here is my custom code with core
    }
}

Please help me to override this method in Magento 2.2.

Ramanathan
  • 216
  • 2
  • 7

1 Answers1

0

If you enter namespace and module name in lower case then try to replace it with CamelCase like namespace\module_name with Namespace\Module and rename folders also.

Rehan Mobin
  • 558
  • 2
  • 14