最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
magento 购物车仿京东勾选下单实现教程
时间:2015-05-22 编辑:简简单单 来源:一聚教程网
该功能仿照了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);
}
相关文章
- 快看漫画app购物车怎么清空 07-27
- 快看漫画app中快看商城如何清空购物车 07-26
- 旺信购物车不见了怎么办 旺信购物车不见了解决方法 03-24
- Laravel 5.2 中快速实现购物车功能例子 07-01
- magento2购物车添加支付方式教程 07-20
- ecshop购物车退出不清空几种方法 10-31