Best way to add a discount to selection variants and/or categories

How to configure and adapt Aimeos based shops as developer
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!
Doggiefield
Posts: 18
Joined: 13 May 2020, 13:07

Best way to add a discount to selection variants and/or categories

Post by Doggiefield » 10 Jun 2020, 16:01

We are Using Aimeos 2019-10

I'm hoping you can help us with 2 questions:
1) We have added selection products with 40 variants. of those variants 30 have a different price then the selection product itself.
Now we want to apply a discount of 25% on this product (and variants)
I have attached a screenshot of how we build the pricing option. We have added the option to add a discount percentage, automatically the discount ammount is filled in based on the discount percentage. This is working fine.

But how can I add a discount to a selection product that also applies this discount on the variants(subproducts) with a different price?

2) The other issue we have is that our client sometimes want to apply a discount percentage on all products from a specific category. Does Aimeos provide such a function and does it work also on the subproducts since they have no category attached to them?
Attachments
add-product-pricing.png
add-product-pricing.png (19.24 KiB) Viewed 1123 times

User avatar
aimeos
Administrator
Posts: 7881
Joined: 01 Jan 1970, 00:00

Re: Best way to add a discount to selection variants and/or categories

Post by aimeos » 13 Jun 2020, 11:47

Doggiefield wrote: 10 Jun 2020, 16:01 1) We have added selection products with 40 variants. of those variants 30 have a different price then the selection product itself.
Now we want to apply a discount of 25% on this product (and variants)
I have attached a screenshot of how we build the pricing option. We have added the option to add a discount percentage, automatically the discount ammount is filled in based on the discount percentage. This is working fine.

But how can I add a discount to a selection product that also applies this discount on the variants(subproducts) with a different price?
You can extend the Product Selection JQAdm class and apply the discount on those price items too when saving the product:
https://github.com/aimeos/ai-admin-jqad ... d.php#L264
Doggiefield wrote: 10 Jun 2020, 16:01 2) The other issue we have is that our client sometimes want to apply a discount percentage on all products from a specific category. Does Aimeos provide such a function and does it work also on the subproducts since they have no category attached to them?
No, because if you apply the discount dynamically in the frontend it doesn't scale and the sorting by price won't be correct.

The only way to do it right is to apply the discount in the admin interface so the prices are recalculated and the new prices are stored in the database. I would suggest to implement a new top-level "Price" panel where shop owners can select the products based on some rules and where they can enter a percentage for decreasing or increasing the prices of these products. As this could affect thousands of products (or more), the task of updating the prices should be done by a job controller in the background, esp. because the index must be updated too for these products.

We would be interested in such a panel too and if you can implement it, we would maintain it in the core.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply