magento - 获取购物车中的总额,运费,tax ,count,grandtotal等
//购物车中产品个数:$totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount(); //total items in cart//$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object//产品总
·
//购物车中产品个数:
$totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount(); //total items in cart
//
$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object
//产品总额小计
$subtotal = $totals["subtotal"]->getValue(); //Subtotal value
echo "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 amount
Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShipping_amount();
更多推荐
所有评论(0)