Get tax amount on gratitude page in magento

I'm trying to get the tax amount to subtract from the total amount or just get the guest subtotal amount so that I can put it in the affiliate link, but I can not get the tax amount or bare subtotal in the last thank you page after the customer clicks the order button places. I tried

<?php echo $_product->getData('tax_amount'); ?> 

and

  $totalItemsInCart = Mage::helper('checkout/cart')->getItemsCount(); //total items in cart $totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object $subtotal = round($totals["subtotal"]->getValue()); //Subtotal value $grandtotal = round($totals["grand_total"]->getValue()); //Grandtotal value if(isset($totals['tax']) && $totals['tax']->getValue()) { $tax = round($totals['tax']->getValue()); //Tax value if present } else { $tax = ''; } echo $tax; 

but no luck, I could not get the amount of tax, I could just get the subtotal with the amount of tax. so please any help would be greatly appreciated

Thank you

+4
source share
1 answer
 Mage::helper('checkout')->getQuote()->getShippingAddress()->getData('tax_amount') 

Here you will receive your tax amount

+11
source

All Articles