0

I've used the following function to retrieve the products to display products on a widget filtered by catalog rules. The products listed in view page shows that rules are applied.

But the function getMatchingProductIds() retrieves all product IDs other than applied products

$catalog_rule = Mage::getModel('catalogrule/rule')->load(2);  
$skus = $catalog_rule->getMatchingProductIds();

print_r($skus);

How to retrieve the products on which the rule is applied?

  • and what's the question here? – Marius Mar 11 '15 at 12:20
  • How to retrieve the products on which the rule is applied? – sugandhi Mar 12 '15 at 11:59
-1

At last I found a way to do this. I know it is a not a big thing.But as a beginner it was helpful for me and want to help someone in search of this.

$product_ids= Mage::getModel('catalogrule/resource_rule')->getRuleProductIds(2);

// 2 is rule id

It retrieves all the product ids on which the rule is applied

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.