B-219 Sec-55 Noida, India
+918010221733

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());
var_dump($oRule->getData());
(Visited 457 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.