I want to create a series of rules that will discount user's carts in specific time intervals after their cart has been created. I can think of two way to do this. I realize that I will most likely need the rules_scheduler module as well. This site is built using Commerce.

My first idea was to create discount codes for each discount level (5OFF for 5% off, 10OFF for 10% off, etc.) that will only be enabled for that specific user during each respective timeframe. This would require these codes to be both enabled and disabled in order to transition properly. However, from what I currently understand, these discount codes are global. So this method would not work. My second idea will still read the order created date. Two days after that, the rule will multiply their oder by .95. After five days that amount will change to .9. continuing as necessary.

Essentially: 1) User creates an account and adds products to his cart. 2) After 2 days pass, they will be given 5% off of this order. 3) After 5 days pass, they will be given 10% off of this order. and so on.

My question is has anybody has tackled this issue before? I would like to receive some insight or advice on how to best accomplish this type of functionality . So far, I have been unsuccessful in figuring out how to make an order creation be the event to react on for this/these rules. I also have not used rules scheduler yet, but I do not foresee that being too difficult to configure. Thanks!

1 Answer 1


I haven't done anything date related, but I have made some rules to apply discount based on various specifications. You should checkout the Commerce Discount module, it integrates in with rules.

So you would just need to create a rule to add a scheduler item for each of the time periods that you are interested in when the user adds an item to their cart, or whatever event you need.

Then when each scheduled item goes off, you would have a rule to apply a discount to their order, and do whatever else you want (maybe notify them by email).

Then a final rule that would delete any additional scheduled items once the order is marked at complete.

You should be able to accomplish all this with a few rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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