4

I would like to display discount amount and grand total (including discount) in mini cart with Magento 1.9 instead of sub total.

  1. I didn't find out how to display discount (cart price rule without coupon)

  2. Following this topic : How do I get the discount amount in the minicart for 1.9?

I have been able to display the grand total including the discount... but it is not working for not logged in users.

Any idea ?

3

You have to load the quote first:

<?php
    $quote = Mage::getModel('checkout/session')->getQuote();
    $quoteData = $quote->getData();
    $grandTotal = $quoteData['grand_total'];
?>

Then simply replace $this->getSubtotal() with $grandTotal.

To get the actual discount amount, you can use this:

$discountTotal = 0;
foreach ($quote->getAllItems() as $item){
    $discountTotal += $item->getDiscountAmount();
}
0

if you use 'quote', you can use this code

$this->getData('grand_total');

In other case use

$quote->getData('grand_total');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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