开发者

getShippingIncludeTax - the right way to code

Im building a webshop on Magento Platform (still localhost) and would like to have the shipping displayed in my header cart.

Currently the shipping rate is shown okay in the main cart but in the header cart it's displayed withouth tax.

This is the code of the main cart: ( the right one with tax included)

<?php echo $this->helper('checkout')->formatPrice($this开发者_如何学运维->getShippingIncludeTax()) ?>

This is the code of the header cart: ( displayed without tax)

<?php echo Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingAmount(); ?>

As you can see the "getShippingIncludeTax" should be added instead of just the amount. Any ideas how to implement this code together?

Extra: This code also works for the header, but has the same amount withouth tax.

<?php $totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals();
        if(isset($totals['shipping']))
        print __(number_format($totals['shipping']->getDat('value'),2)); ?>


would that be better ?

<?php echo Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getShippingIncTax(); ?>

It's actually rather easy to see whats inside your object and what you can ask from it

<?php print_r(array_keys(Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getData()));?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜