1条回答 默认 最新
- douzhan1868 2016-05-31 13:42关注
You have to make an Ajax call and execute the following functionality:-
// Product ID and Quantity $pid = $_REQUEST['productId']; $qnt = $_REQUEST['qty']; $cart = Mage::getSingleton('checkout/cart'); $items = $cart->getItems(); foreach ($items as $item) : if($pid == $item->getId()) : echo $item->getQty(); $item->setQty($qnt); $cart->save(); endif; endforeach;
This is just an example, you need to manage the variables according to your need. Whenever button is press just make a ajax call and update cart and then you need to update it via Ajax in other place where you want. Above code provide you the way to save product quantity to cart.
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报