I see some answers about set custom price in product when add to cart.
But, I can't still solve my issue. I used observer for that to set custom price.
But, it's not working.
Can anyone please help me to solve it?
My code :
public function execute(\Magento\Framework\Event\Observer $observer) {
$item = $observer->getEvent()->getData('quote_item');
$product = $observer->getEvent()->getData('product');
$itemProId = $item->getProduct()->getId();
$custom_price = $product->getPrice() + 10;
$item->setCustomPrice($custom_price);
$item->setOriginalCustomPrice($custom_price);
$item->getProduct()->setIsSuperMode(true);
}