B-219 Sec-55 Noida, India
+918010221733

Magento – check if coupon code used

Once on the Onepage Checkout page, I need to track if the customer has used any specific coupon code. This can be checked by the checkout session.
Use this code to hunt up the coupon code. This code will return the coupon code if used or empty result.

<?php
$coupon_code = Mage::getSingleton(‘checkout/session’)->getQuote()
                                                     ->getCouponCode();
if($coupon_code){
    echo “coupon used”;
}else{
    echo “coupon not used”;
}
?>


(Visited 56 times, 1 visits today)

Leave a reply