I'm trying to create plugin for getProductPrice
but \Magento\Catalog\Block\Product\ListProduct
Block Class not generate Interceptor Class like Magento\Catalog\Block\Product\ListProduct\Interceptor
.
My 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">
<type name="Magento\Catalog\Block\Product\ListProduct">
<plugin name="addSimplePriceUnit" type="MagArs\PriceUnit\Plugin\Product\Simple"/>
</type>
</config>
My plugin Class
namespace MagArs\PriceUnit\Plugin\Product;
class Simple {
public function beforeGetProductPrice(\Magento\Catalog\Block\Product\ListProduct $subject, $result){
return $result;
}
}
moduel.xml file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MagArs_PriceUnit" setup_version="1.0.0">
<sequence>
<module name="Magento_Catalog"/>
</sequence>
</module>
</config>
I am using magento enterprise version 2.2.5