最新下载
热门教程
- 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);
}
相关文章
- 《无限暖暖》天星之羽获得位置介绍 12-20
- 《流放之路2》重铸台解锁方法介绍 12-20
- 《无限暖暖》瞄准那个亮亮的成就怎么做 12-20
- 《无限暖暖》魔气怪终结者完成方法 12-20
- 《无限暖暖》曙光毛团获得位置介绍 12-20
- 《无限暖暖》日光果获得位置介绍 12-20