How to access to the discount price in Magento?

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.

2 thoughts on “How to access to the discount price in Magento?”

  1. 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;       
    }
    

Leave a Reply

Your email address will not be published. Required fields are marked *