I need to change price of products using plugin. I used following method for it.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Model\Product">
<plugin name="change_price" type="Namespace\Module\Plugin\Price" />
</type>
</config>
Created following plugin class:
namespace Namespace\Module\Plugin;
class Price
{
public function afterGetPrice(\Magento\Catalog\Model\Product $subject, $result){
return $result;
}
}
This is working perfectly for simple product but this is not working with configurable product. I need to carry all type of products.