Product discount not calculated correctly?
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Product discount not calculated correctly?
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.
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.
Re: Product discount not calculated correctly?
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, give us a star
If you like Aimeos, give us a star
Re: Product discount not calculated correctly?
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.
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.
Re: Product discount not calculated correctly?
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 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.
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, give us a star
If you like Aimeos, give us a star
Re: Product discount not calculated correctly?
Thank you! The category rule is probably exactly what I need.