I want to update the product price using plugin and I tried the afterGetPrice() plugin its working fine in normal case but showing wrong price calculation when catalog price rule applied, I want to apply catalog price rule before the plugin execution. I tired the below code :
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\Model\Product">
<plugin name="change_product" type="Vendor\Module\Plugin\Product" sortOrder="1" disabled="false"/>
</type>
</config>
Product.php
public function afterGetPrice($product, $proceed) : float
{
return $proceed+111.55;
}
I want to apply catalog price rule before the plugin execution.
di.xml
andmodule.xml
, also mention the file for this codeafterGetPrice()
you have mentioned.