How do I get the discount amount in the minicart for 1.9?
-
12-12-2019 - |
Question
In the minicart of 1.9, the total is produced by $this->getSubtotal(). See file app/design/frontend/rwd/default/template/checkout/cart/minicart/items.phtml.
That total does not subtract any potential discounts (created as shopping cart price rules). How can I access potential discounts in the minicart? In the full shopping cart the discount is subtracted automatically from the total but the same code does not work in the minicart.
In Magento 1.7 it produced the correct total (including discount) but something has changed for 1.9.
Solution
Figured it out. Replace $this->getSubtotal()
with $this->getQuote()->getGrandTotal()
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange