Cart – Base Subtotal Including Tax Calculation

carttaxtotals

I need to get base subtotal including tax. This

Mage::helper('checkout/cart')->getQuote()->getBaseSubtotal()

will show subtotal without tax, even if config Display Subtotal is set to Including tax.

This

$totals = Mage::getSingleton('checkout/cart')->getQuote()->getTotals();
$totals["subtotal"]->getValue()

will show subtotal with tax (if config Display Subtotal is set to Including tax).

But I can not find any method to display base subtotal with tax. Does anybody have any idea?

tnx

Best Answer

Try the code below:

$quote = Mage::helper('checkout/cart')->getQuote();
$tax = $quote->getGrandTotal() - $quote->getBaseSubtotal();

EDIT:

I just found a more elegant solution:

Mage::helper('checkout')->getQuote()->getShippingAddress()->getTaxAmount();