Magento 1.9 – How to Get Discount Amount in Minicart

cartmagento-1.9mini-cartshopping-cart-price-rules

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.

Best Answer

Figured it out. Replace $this->getSubtotal() with $this->getQuote()->getGrandTotal()