嗨,我正在使用 ajax 添加到购物车模块,单击添加到购物车后,弹出显示我的商品已添加到购物车,但我的购物车在刷新页面之前不会更新。
这是我的 cartcontroller.php 代码
class AW_Ajaxcartpro_CartController extends Mage_Core_Controller_Front_Action
{
public function removeAction()
{
$response = Mage::getModel('ajaxcartpro/response');
$id = $this->getRequest()->getParam('id');
Mage::getSingleton('checkout/cart')->removeItem($id)->save();
if($this->getRequest()->getParam('is_checkout')) {
$response->setCart(Mage::helper('ajaxcartpro')->renderBigCart());
if(AW_Ajaxcartpro_Helper_Data::RETURN_CARTBAR_ON_BIGCART)
$response->setCartbar(Mage::helper('ajaxcartpro')->renderCart());
} else {
$response->setCart(Mage::helper('ajaxcartpro')->renderCart());
}
$response->setLinks(Mage::helper('ajaxcartpro')->renderTopCartLinkTitle());
$_quote = Mage::getSingleton('checkout/session')->getQuote();
if($_quote && $_quote->getHasError()) $response->setError('quote error');
$response->send();
}
}
我应该在哪里编辑代码