I have to retrieve the rule associated to a coupon code in order to display in quote the discount percentage of that rule.
the simplest way is to calculate directly from quote amounts, but i want to retrieve directly the rule and then get the discount percentage from it.
this is what i tried:
$rule = Mage::getModel('salesrule/coupon');
$rule->load($couponCode);
by this way i still havent retrieved rules attributes. any help?
thanks.
To load a coupon by code, pass
'code'as 2nd param toload(). Then you can get the proper rule instance by using therule_idvalue of your coupon instance: