magento - 获取购物车中的总额,运费,tax ,count,grandtotal等

来源:互联网 发布:优化旅客列车编组 编辑:程序博客网 时间:2024/05/16 09:53

//购物车中产品个数:$totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount(); //total items in cart//$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object//产品总额小计$subtotal = $totals["subtotal"]->getValue(); //Subtotal valueecho "subtotal:".$subtotal."<br>";//订单总额(打折,优惠后的价格)$grandtotal = $totals["grand_total"]->getValue(); //Grandtotal value//折扣$discount = $totals['discount']->getValue(); //Discount value if applied//tax$tax = $totals['tax']->getValue(); //Tax value if present//shipping amountMage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShipping_amount();
0 0
原创粉丝点击