3

I am working on magento shop having Enterprise 1.14, In my old shop which is based on magento CE 1.81, there is shopping cart price rule to buy x items and get y free.

After up gradation to EE 1.14, this rule applies only on first item of cart out of z items meeting the criteria. In my rule definition I have set stop further processing to Yes and rule's priority is 0 which mean this rule should run on each item of cart and stop to affect any other rule but it works only first item of cart and then nothing.

When I dig into code, I saw they have below code in foreach loop at line 317 of Mage_SalesRule_Model_Validator model.

if ($this->_stopFurtherRules) {
            break;
        }

In release notes of Magento CE 1.9 and EE 1.14, they have mentioned that

The setting Stop Further Rules Processing is honored.

so my question is, what does mean of **The setting Stop Further Rules Processing is honored. **?

Have they changed the meaning of Stop Further Rules Processing or is it bug in magento CE 1.9 and EE 1.14?

  • I would say that the old behavior which allowed a single rule to apply to all products before "stopping" was unintentional. My suggestion would be to extend this with a new attribute for the rule which would read something like "Apply to all products before stopping" but there might be a lot of custom logic there. – Tyler V. Jul 23 '14 at 3:06
2

Though this is not answer of question. I still don't know why they have written code like this but below is my patch to make it work as in older version.

I override Mage_SalesRule_Model_Validator model and overload process function.

public function process(Mage_Sales_Model_Quote_Item_Abstract $item){
     $this->_stopFurtherRules = false;
     parent::process($item)
}

so now a matched rule will run on all cart items instead of first one only.

May be it is helpful for someone :)

  • After two unsuccessful patches from Magento's tech support, I eventually came up with this solution on my own, and came here to post it, only to find that you already did :) – Tyler V. Aug 3 '14 at 21:37
  • I have word from Magento that an internal request has already been filed to include this patch in the next version of Magento. This would support the idea that this change was not intentional on their part. – Tyler V. Aug 11 '14 at 23:51
0

Stop Further Rules Processing

This means that once the first rule match occurs that no other rules will be matched. I would use this flag to limit the amount of cart prices at can effect a single user.

Say if you have one 20% discount for condition x and then another 20% discount for condition y.

If the users cart matches condition x and y you can use this filter to stop both discounts being applied.

  • but one rule should apply on all items, not only first one. – murtza gondal Jun 24 '14 at 10:10
  • my rule is if user purchases x then y is free and if I add 3 different product's x amount, it should allow me y of each free, not the first one. – murtza gondal Jun 24 '14 at 10:12
  • This is only happening in magento EE 1.14 and CE 1.9+, old versions are fine and their code look fine, don't know why new versions have code like this. – murtza gondal Jun 24 '14 at 10:14
  • can you share how your rule is setup – David Manners Jun 24 '14 at 10:15
  • rule is fine, screencast.com/t/PaKgqtIZ3t – murtza gondal Jun 24 '14 at 10:34

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.