$item = $observer->getEvent()->getQuoteItem(); $item = ( $item->getParentItem() ? $item->getParentItem() : $item ); $_product = Mage::getModel('catalog/product')->load($item->getProductId()); $finalPrice = $Customprice + $_product->getPrice(); $item->setCustomPrice($finalPrice); $item->setOriginalCustomPrice($finalPrice); $item->getProduct()->setIsSuperMode(true); $item->save();
After that when customer as guest logged in and customer add to cart any of the product at that time display the error like:
"Cannot add the item to shopping cart"
How to fix this error?
Solved! Go to Solution.
Hi,
try to remove the last line "$item->save()"
this can make problems when it`s about a guest customer.
To see the root problem, share the last error message from /var/log/exception.log file.