对于Magento 版本1.4.1.1版本来说,可能会导致产品无法添加到购物车页面,提示错误cannot add item to shopping cart。
这个错误会在如下的条件下产生
1 客户没有登录( The user is not logged in)
2 商店设置了购物车打折规则(There is a shopping cart rule)
3 使用非Magento默认的支付方式 (There are only non default Magento payment methods).
修正的方法如下:
找到 app/code/core/Mage/Sales/Model/Quote/Payment.php 文件 ,修改第115行,_beforeSave()这个方法改成:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | protected function _beforeSave() {     if ($this->getQuote())     {         $this->setQuoteId($this->getQuote()->getId());     }     try     {         $method = $this->getMethodInstance();     }     catch (Mage_Core_Exception $e)     {         return parent::_beforeSave();     }     $method->prepareSave();     return parent::_beforeSave(); } | 
