I want to be able to change price on Quote Items to be different than on Products, based on several Tutorials I have used this code:
$quoteItem->setCustomPrice($price);
$quoteItem->setOriginalCustomPrice($price);
$quoteItem->getProduct()->setIsSuperMode(true);
$quote->save();
After that when I get to cart it shows normal prices, not custom price. I have checked Quote Items in cart and they have correct customPrice, but it seems to be ignored. Do I have to activate something else to make this custom prices to take effect?
PS:
Magento v1.7
OK, so I found the problem, somehow it didnt get saved in my script. Not sure why, but I have rewritten my code into 2 functions, 1 for adding product, the other for changing price.
So this code is all that is necessary:
$quoteItem->setCustomPrice($price);
$quoteItem->setOriginalCustomPrice($price);
$quoteItem->getProduct()->setIsSuperMode(true);
$quoteItem->save();
No need to save quote, just quoteItem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With