【发布时间】:2016-01-23 14:29:54
【问题描述】:
基本上我在 SUPEE 7405 更新后遇到了这个问题。每当我将某些东西添加到购物车然后单击 AJAX 购物车中的删除项目时,它都会告诉我“无法删除该项目。”
我必须刷新页面,然后才能成功删除该项目。 基本上添加然后立即删除 item=Doesnt 工作。我需要添加,刷新页面(或转到网站的其他页面),然后单击删除。
我注意到补丁被覆盖了 app/code/core/Mage/Checkout/controllers/CartController.php
补丁前的代码
/**
* Delete shoping cart item action
*/
public function deleteAction()
{
$id = (int) $this->getRequest()->getParam('id');
if ($id) {
try {
$this->_getCart()->removeItem($id)
->save();
} catch (Exception $e) {
$this->_getSession()->addError($this->__('Cannot remove the item.'));
Mage::logException($e);
}
}
$this->_redirectReferer(Mage::getUrl('*/*'));
}
补丁后的代码
/**
* Delete shoping cart item action
*/
public function deleteAction()
{
if ($this->_validateFormKey()) {
$id = (int)$this->getRequest()->getParam('id');
if ($id) {
try {
$this->_getCart()->removeItem($id)
->save();
} catch (Exception $e) {
$this->_getSession()->addError($this->__('Cannot remove the item.'));
Mage::logException($e);
}
}
} else {
$this->_getSession()->addError($this->__('Cannot remove the item.'));
}
$this->_redirectReferer(Mage::getUrl('*/*'));
}
我的文件中的补丁覆盖了什么导致此问题?
【问题讨论】:
标签: magento magento-1.7 patch