1

I'm trying to rewrite a template for the cart.

I need to retrieve the discount amount but I was not able to find where.

Ie If my coupon code gives me $10 discount I want to retrieve 10, if I have a discount of 5% I want to retrieve 5 if the total price is $100.

Thank you.

JohnT
  • 967
  • 2
  • 16
  • 30

2 Answers2

2

you can debug your object by printing it out and observing what values it contains

print_r($this->getQuote()->getData());
Anton S
  • 12,750
  • 2
  • 35
  • 37
0

I used the following code to access discount price. I was accessing the details of last order in a phtml file. For the last order if there was a discount coupon used then I used following code to access the Discount Amount.

$lastOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();    
$order=Mage::getModel('sales/order')->loadByIncrementID($lastOrderId);                                          

if($lastOrderId) //If order was placed then only display coupon code
 {
    $coupon=$order->getCouponCode();
    echo "<b>Discount coupon used during order:</b>".$coupon;
    $disAmount=$order->getDiscountAmount();
    echo "<br/>Discount Amount: ".$disAmount;       
}
Mukesh
  • 7,630
  • 21
  • 105
  • 159