I am using magento 2.4.3 EE version
Is their any way to override below method
protected function _calculate($rule, $item, $qty, $rulePercent)
for below classes
\Magento\SalesRule\Model\Rule::TO_PERCENT_ACTION =>
\Magento\SalesRule\Model\Rule\Action\Discount\ToPercent::class,
\Magento\SalesRule\Model\Rule::BY_PERCENT_ACTION =>
\Magento\SalesRule\Model\Rule\Action\Discount\ByPercent::class,
\Magento\SalesRule\Model\Rule::TO_FIXED_ACTION => \Magento\SalesRule\Model\Rule\Action\Discount\ToFixed::class,
\Magento\SalesRule\Model\Rule::BY_FIXED_ACTION => \Magento\SalesRule\Model\Rule\Action\Discount\ByFixed::class,
\Magento\SalesRule\Model\Rule::CART_FIXED_ACTION =>
\Magento\SalesRule\Model\Rule\Action\Discount\CartFixed::class,
\Magento\SalesRule\Model\Rule::BUY_X_GET_Y_ACTION =>
\Magento\SalesRule\Model\Rule\Action\Discount\BuyXGetY::class,
The _calculate method is common method for the above classes. I want to add some code in all these class to make changes in all cart rules.
Is there anyway to do within module ? I know about extending class & use of plugins so some idea needed on modifying this method for all classes at once.