Magento,我的购物车,小计

时间:2012-07-25 17:58:21

标签: magento cart subtotal

我的购物车显示错误的小计,我认为这也影响了Shoppin购物车和Checkout中的税金计算(20%)(这里的价格是正确的,但小计,总计,没有20%的增值税)
知道可能是什么问题吗?

新用户..我无法发布图片

1 个答案:

答案 0 :(得分:0)

 <?php 

$subTotal = Mage::getModel('checkout/cart')->getQuote()->getSubtotal();

$totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals();?>
 Total Items in Cart: <?php $totalItems = Mage::getModel('checkout/cart')->getQuote()->getItemsCount();  
                if($totalItems == 0){echo "0";}else{echo $totalItems;}?>
  Subtotal: $ <strong><?php $subTotal = Mage::getModel('checkout/cart')->getQuote()->getSubtotal(); echo number_format($subTotal,2); ?>
 <?php  if(isset($totals['tax']) && $totals['tax']->getValue()) {
  echo 'Tax: '.strip_tags(Mage::helper('core')->currency(number_format($totals['tax']->getValue(),2))); //Tax value if present
} ?>
<?php if(isset($totals['discount']) && $totals['discount']->getValue()) {
    echo 'Discount: '.strip_tags(Mage::helper('core')->currency(number_format($totals['discount']->getValue(),2))); //Discount value if applied
} ?>
<?php if(isset($order->getShippingAmount)){
echo 'Shipping Charges:'.strip_tags(Mage::helper('core')->currency(number_format($order->getShippingAmount,2)));
}?>
 Grand Total: $<?php $grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal(); echo number_format($grandTotal,2); ?>

请使用此代码,它将显示所有购物车信息。