Product discount not calculated correctly?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
kdim95
Advanced
Posts: 207
Joined: 26 Aug 2022, 12:17

Product discount not calculated correctly?

Post by kdim95 » 26 Oct 2022, 13:37

Laravel framework version: 9.36.4
Aimeos Laravel version: * 2022.07.2
PHP Version: 8.1.9
Environment: Linux

I have added a product with BGN (leva) currency and added a discount.
The price is 100 leva, the discount is 50 leva.
The frontpage shows that the discount is 33%, but shouldn't it be 50%?
I don't think I've entered any VAT or something anywhere.

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

Re: Product discount not calculated correctly?

Post by aimeos » 27 Oct 2022, 14:58

No, the price you've entered in the admin backend into the "Actual price" field is the current price and the rebate value added below is the already subtracted rebate, so the calculation is:

Code: Select all

rebate * 100 / (actual price + rebate) -> 50 * 100 / (100 + 50)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kdim95
Advanced
Posts: 207
Joined: 26 Aug 2022, 12:17

Re: Product discount not calculated correctly?

Post by kdim95 » 31 Oct 2022, 13:04

Thanks.

I may want to change this functionality so that I can enter a product price and have a discount % field.
A tip on what files I need to change for this would be appreciated.
The goal is not having to calculate the final price myself to get, for example, a 25% discount for product or products.

I am also interested in creating categories with discounts, where the product is discounted simply by putting it in the category.
Some tips on how to achieve this would also be appreciated.

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

Re: Product discount not calculated correctly?

Post by aimeos » 31 Oct 2022, 16:33

kdim95 wrote: 31 Oct 2022, 13:04 I may want to change this functionality so that I can enter a product price and have a discount % field.
A tip on what files I need to change for this would be appreciated.
The goal is not having to calculate the final price myself to get, for example, a 25% discount for product or products.
The actual price must be always the end price the customer has to pay because it's uses for filtering products too. You may change the price panel template of the admin backend but the stored values must be the same as now.
kdim95 wrote: 31 Oct 2022, 13:04 I am also interested in creating categories with discounts, where the product is discounted simply by putting it in the category.
Some tips on how to achieve this would also be appreciated.
Use the price rules:
https://aimeos.org/docs/latest/manual/rules/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

kdim95
Advanced
Posts: 207
Joined: 26 Aug 2022, 12:17

Re: Product discount not calculated correctly?

Post by kdim95 » 31 Oct 2022, 23:37

Thank you! The category rule is probably exactly what I need.

Post Reply