0

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

新用户..我不能发布图片

4

1 回答 1

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); ?>

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

于 2014-04-24T10:10:52.490 回答