I know this is pretty complex task, I don't expect a solution, but a guide on where to start.

(Drupal 7 is in question)

I need to apply X% discount for every Nth products that are in the same category. Category, X and N needs to be imputed by user.

So far, I was able to make a rule (with fixed X, N and category) that calculates a needed total discount that needs to be subtracted from total amount. How can I apply that number (or should I do something different?), and how to get user's input for X, N and category?

Thank you for any help.


Depending on how you've constructed your product data model, the Per-quantity category discount (% off) offer type supplied by the Commerce Discount Extra module should just work. It lets you specify how many products of which product category must be present on an order before the next one is discounted by any percentage (e.g. buy 2, get 1 free - 100% off). It's repeatable, meaning you can apply the discount any number of times on the same order so long as the right quantity is present, and you have some rudimentary sorting options - e.g. discount the cheapest or most expensive first.

If that solves it for ya, mark this answer as accepted. If you need a little more detail, feel free to add a comment and I'll help if I can. : )

  • 1
    Thank you for your time. I've solved the problem using rules and creating a custom form for the discount details, but I'll look into your approach, and implement it if I have the chance. Thank you for the effort :) – Jon Jan 10 at 20:32
  • Cool, good luck with it all! : ) – Ryan Szrama Jan 11 at 21:05

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.