我遇到了以下错误
答案 0 :(得分:2)
这似乎是CE 1.9中的一个错误
Mage_Checkout_CartController :: couponPostAction()
中设置了新的会话值$this->_getSession()->setCartCouponCode($couponCode);
恢复Mage_Checkout_Model_Type_Onepage :: _ setCartCouponCode()
中的优惠券代码protected function _setCartCouponCode()
{
if ($couponCode = $this->getCheckout()->getCartCouponCode()) {
$this->getQuote()->setCouponCode($couponCode);
}
return $this;
}
我通过事件/观察者解决了它
<events>
<controller_action_predispatch_checkout_cart_couponPost>
<observers>
<remove_session_coupon_code>
<type>singleton</type>
<class>yourmodule/observer</class>
<method>removeCoupon</method>
</remove_session_coupon_code>
</observers>
</controller_action_predispatch_checkout_cart_couponPost>
</events>
和
public function removeCoupon(Varien_Event_Observer $observer)
{
$controller = $observer->getControllerAction();
if ($controller->getRequest()->getParam('remove') == 1) {
Mage::getSingleton("checkout/session")->unsetData('cart_coupon_code');
}
return $this;
}