B-219 Sec-55 Noida, India

Magento – get rule from coupon code

To load a coupon by code, pass ‘code’ as 2nd param to load(). Then you can get the proper rule instance by using the rule_id value of your coupon instance:

$oCoupon = Mage::getModel(‘salesrule/coupon’)->load($couponCode, ‘code’);
$oRule = Mage::getModel(‘salesrule/rule’)->load($oCoupon->getRuleId());
(Visited 455 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.