Wednesday, 11 September 2013

magento get coupon details from price rule

magento get coupon details from price rule

How do i get the coupons details from rule id.
i am able to getting all the rules from the following code,
$sopping_cart_rules =
Mage::getResourceModel('salesrule/rule_collection')->load();
$sopping_cart_rule_info = array();
foreach ($sopping_cart_rules as $rule) {
//only for active rules
if ($rule->getIsActive()) {
$sopping_cart_rule_info['shopping_cart_rules'] = array(
'id'=>$rule->getId(),
'name'=>$rule->getName()
);
}
}
But, how do i get the coupon codes from rule id(i.e passing rule id as the
parameter )

No comments:

Post a Comment