Here's a simple snippet in order to retrieve this 2 useful infos about user's cart.
Here you retrieve the amount of items the user has into the cart:
$Qty = $this->helper('checkout/cart')->getSummaryCount();
Here you get the total price of those items:
$quote = Mage::getModel('checkout/session')->getQuote();
$total = $quote->getGrandTotal();
// format total in order to have a user friendly price
$total = $this->helper('checkout')->formatPrice($total);
本文提供了一段简单的代码片段,用于从用户的购物车中检索两项有用的信息:购物车中的商品总数及这些商品的总价。
3739

被折叠的 条评论
为什么被折叠?



