7

i want and need in cart display Grand Total price without include tax, but tax price should be display in different line. How i can do this? where i can modify file?

Thanks

4 Answers 4

5

This will get you your carts subtotal:

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

This will get your your carts grand total:

Mage::helper('checkout')->formatPrice(Mage::getModel('checkout/cart')->getQuote()->getGrandTotal());
4
  • ok, good, now how i can get price in cart next: 1. grand total without table rate price? 2. get table rate price? - displayShippingPriceIncludingTax in cart not working 3. get tax value price in cart
    – Sergey
    Oct 23, 2014 at 23:05
  • Here's someothing you can do to find variables to call using Magentos getX function system: $subtotal = Mage::getModel('checkout/cart')->getQuote(); var_dump($subtotal); This will dump all the variables that you can interact with from $subtotal. Oct 24, 2014 at 12:11
  • how about tax and shipping?
    – Sergey
    Oct 27, 2014 at 16:10
  • @Sergey you could just subtract the grandtotal from the subtotal to get taxed amount Oct 28, 2014 at 13:24
6

Have you tried this config setting in the admin panel?

System > Configuration > Tax > Shopping Cart Display Settings

System > Configuration > Tax > Shopping Cart Display Settings

1
  • You are welcome @PriyaPonnusamy!
    – MaierB
    Dec 14, 2016 at 14:58
2

Ok, so I figured it out. Appertently it's a core bug in Magento 1.9.2.4.

Go to: app/code/core/Mage/Tax/etc/config.xml

Change line: 165

From:

<after>freeshipping</after>

To:

<after>subtotal,nominal,shipping,freeshipping</after>

Read about the fix here:

https://github.com/OpenMage/magento-lts/pull/84

1
  • This actually fixed a similar bug on V 1.7.0.2 somehow. Perhaps was part of a security patch May 8, 2020 at 20:25
1

This is magento bug.

Add this line of code in app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php at 1532 line no.

if ($this->_config->displayCartTaxWithGrandTotal($store)) {
            $grandTotal = $address->getSubtotal() + $address->getShippingAmount() + $taxAmount - $address->getShippingTaxAmount();
            $address->setGrandTotal($grandTotal);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.