Buy n products at Total X



We have a requirement where customer have a promotion Buy 4 at Total £50. and when Customer have 3 items in basket a message will display to promote him buy another product so he could get this offer.

Items can be rom any category of any price.

How can we do this? i am looking for opinions.

In my opinion

We have to develop a custom promotion. to achive Buy 4 at Total 50.
To display a message in in Basket we can do it in two ways

Create a custom Commerce customer Visitor Criteria Group that will do this for us, Editors will require to create those groups and add required items, On basket page content will be displayed based on this criteria. (Probably will be efficient way to do this)

On visiting basket page, We can load some all/specific promotion and view items and then compares with items in basket. (will be poor in performance, potentially will involve direct DB access, high usage of DB)


Sep 04, 2015 10:06


As I might not understand the whole requirement, my solution might not be complete, but here's the idea:

- Add a special flag, such as "SuperCool4Item50GBPDiscount", with type of bool, can be set by code. This will be synced manually with the promotion (will be disable when the promotion is expired,...)

- Everytime customer adds a item to the cart, you'll need to run the CartValidate workflow, so after this, you can check the number of items and order subtotal. If it does not satisfy the requirements and the flag is enabled, display the message.

So this will reduce a lot of database requests as all the things you use are already in the memory.

As I said I might not see the whole picture :)



Sep 04, 2015 10:38


Lets make it bit generice,

Buy N at £X

I can't create N boolean :)

Any other idea?


Sep 04, 2015 10:45

So you will possibly have multiple promotions of that type at the same time?

Sep 04, 2015 12:43


Sep 04, 2015 12:44
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.