最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
magento 购物车仿京东勾选下单实现教程
时间:2022-11-14 22:03:53 编辑:袖梨 来源:一聚教程网
该功能仿照了Wishlist功能,构造了一个新的购物车系统,用户更新删除购物车item ,操作新的数据库表
两个方法
public function removeCancelByAjaxAction()
{
$result = array();
$itemId = (int) $this->getRequest()->getParam('itemId');
if($itemId){
try{
$newQuoteItemId = Mage::getModel("newshoppingcart/simulation")->addNCItemToCart($itemId);
$result['status'] = "success";
$result['content'] = $this->getLayout()->createBlock('checkout/cart_totals')->setTemplate('checkout/cart/totals.phtml')->toHtml();
$result['newQuoteId'] = $newQuoteItemId;
}catch (Exception $e){
$result['status'] = "fail";
$result['error'] = "Exception when call addNItemToCart function,Msg:".$e->getMessage();
}
}
echo json_encode($result);
}
public function removeCancelByAjaxAction()
{
$result = array();
$itemId = (int) $this->getRequest()->getParam('itemId');
if($itemId){
try{
$newQuoteItemId = Mage::getModel("newshoppingcart/simulation")->addNCItemToCart($itemId);
$result['status'] = "success";
$result['content'] = $this->getLayout()->createBlock('checkout/cart_totals')->setTemplate('checkout/cart/totals.phtml')->toHtml();
$result['newQuoteId'] = $newQuoteItemId;
}catch (Exception $e){
$result['status'] = "fail";
$result['error'] = "Exception when call addNItemToCart function,Msg:".$e->getMessage();
}
}
echo json_encode($result);
}
相关文章
- 第五人格11.22共研服有什么更新 11月22日共研服更新内容介绍 11-21
- 原神恰斯卡怎么培养 11-21
- 无期迷途四星装束是谁 11-21
- 王者荣耀帝丹高中校服怎么获得 11-21
- 光遇姆明季后续版本怎么玩 11-21
- 《潜行者2:切尔诺贝利之心》使用手电筒方法介绍 11-21