Inconsistent rebate value

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!
flomo
Posts: 52
Joined: 26 Sep 2019, 15:11

Inconsistent rebate value

Post by flomo » 13 Nov 2020, 17:03

I'm using Aimeos\MShop\Price\Item\Standard::getRebate() to get the rebate amount of a product. When there is only one single price, this works fine, it shows the rebate amount.

However, when I add a second price (say for a special sale that ends tomorrow), things are getting weird. On the product details page, getRebate() returns the correct amount for the sale. On the list page however, getRebate() returns 0 (probably the value of the first price, which has no rebate).

Any idea if this is a bug or a mistake on my side?

Also, ist it possible to get the rebate of a product that is already in the cart? getRebate() always returns 0 there.

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

Re: Inconsistent rebate value

Post by aimeos » 16 Nov 2020, 09:38

flomo wrote: 13 Nov 2020, 17:03 However, when I add a second price (say for a special sale that ends tomorrow), things are getting weird. On the product details page, getRebate() returns the correct amount for the sale. On the list page however, getRebate() returns 0 (probably the value of the first price, which has no rebate).
Did you clear the cache to make sure it's no cache problem?

Code: Select all

php artisan aimeos:cache
flomo wrote: 13 Nov 2020, 17:03 Also, ist it possible to get the rebate of a product that is already in the cart? getRebate() always returns 0 there.
No, in the basket the rebate fields are used for discounts granted by coupons or plugins and the value for displaying e.g. "-30%" is not available any more.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

flomo
Posts: 52
Joined: 26 Sep 2019, 15:11

Re: Inconsistent rebate value

Post by flomo » 17 Nov 2020, 09:21

php artisan aimeos:cache
Did you mean

Code: Select all

php artisan aimeos:clear
? I tried that. Also cleared the Laravel views and cache, but the problem persists.

I found out, that changing the order of the prices (first the temporary sale, that overwrites the normal price for a few days) works. But it still looks like a bug to me.

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

Re: Inconsistent rebate value

Post by aimeos » 18 Nov 2020, 08:24

Can you please post some additional data or screenshots?
- Values of both prices
- Start/end date of the prices
- etc.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

flomo
Posts: 52
Joined: 26 Sep 2019, 15:11

Re: Inconsistent rebate value

Post by flomo » 18 Nov 2020, 10:06

With this setting, the rebate is shown on the product detail page, but not on the list page. If I change the order or remove the first (regular) price, the rebate shows on both pages.
_aimeos_prices.jpg
_aimeos_prices.jpg (161.08 KiB) Viewed 1210 times

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

Re: Inconsistent rebate value

Post by aimeos » 18 Nov 2020, 10:36

We've tried to reproduce your issue but the price in the list view is always the small price, regardless of the order of the prices in the backend. Can you debug a bit more and see again if it might be a caching issue nevertheless? You can disable caching in your ./config/shop.php file complete for testing.
admin-multiple-prices.png
admin-multiple-prices.png (166.28 KiB) Viewed 1208 times
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply