Steps to reproduce:
1.Please configure tax settings and tax rules as seen in screenshots.
2.Now login in storefront using Demo Customer Access provided by Magento
([email protected]).
3.Please integrate the below code to apply custom price.
Observer :
namespace Vendor\MyModule\Observer;
use Magento\Framework\Event\ObserverInterface;
class BindPriceToCart implements ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
$price = 100;
$event = $observer->getEvent();
$item = $event->getQuoteItem();
$item->setCustomPrice($price);
$item->setOriginalCustomPrice($price);
return $this;
}
}
Event : checkout_cart_product_add_after
Configurations that needs to be set :
sales_quote_item_set_product
. I'm not saying it will work. I just wondering if usingcheckout_cart_product_add_after
is not too late in the process to change the price.