Discount when 2 or more products from specific categorie are added
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 18
- Joined: 13 May 2020, 13:07
Discount when 2 or more products from specific categorie are added
Hi,
I would like to apply discount only when 2 or more products from a specific category are added.
There are 2 way's (that I can think of) to approach this
1) Add default discount to the product
When the customer adds the product to the basket he will get a notification to add another product from that category to the basket.
2) Use products without discount
When a customer adds a minimum of 2 (different) products from a specific category; a discount on those products is applied
How can I achieve this?
I would like to apply discount only when 2 or more products from a specific category are added.
There are 2 way's (that I can think of) to approach this
1) Add default discount to the product
When the customer adds the product to the basket he will get a notification to add another product from that category to the basket.
2) Use products without discount
When a customer adds a minimum of 2 (different) products from a specific category; a discount on those products is applied
How can I achieve this?
Re: Discount when 2 or more products from specific categorie are added
In the current dev-master version, there's a new rule system to apply price changes depending on arbitrary conditions which makes it much easier to achieve what you want.
For 2020.10 LTS, the easiest way is to create a basket plugin, that adds the discount if two different products of the same category are in the basket:
https://aimeos.org/docs/latest/provider ... t-plugins/
For 2020.10 LTS, the easiest way is to create a basket plugin, that adds the discount if two different products of the same category are in the basket:
https://aimeos.org/docs/latest/provider ... t-plugins/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 72
- Joined: 22 Mar 2021, 16:56
Re: Discount when 2 or more products from specific categorie are added
@ameos
What would be the advantage of using the basket plugin over the controller?
I read somewhere that it was advised certain things should not be done in the plugin but in the controller (basket specific).
I have created similar functionality as OP by decorating the basket controller and apply/remove a coupon of a type percent.
How would the discount look when applying it via the plugin approach?
What would be the advantage of using the basket plugin over the controller?
I read somewhere that it was advised certain things should not be done in the plugin but in the controller (basket specific).
I have created similar functionality as OP by decorating the basket controller and apply/remove a coupon of a type percent.
How would the discount look when applying it via the plugin approach?
Re: Discount when 2 or more products from specific categorie are added
Adding features using a decorator for the basket controller or extending the basket controller is easier to understand but limited in what you can react to. On the other side, a basket plugin can react on any event even not related to something the basket controller cares about but event systems are hard to debug.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star