BasketLimits plugin problems

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!
User avatar
РоманАндрейчук
Posts: 18
Joined: 13 Jan 2022, 15:08

BasketLimits plugin problems

Post by РоманАндрейчук » 25 Oct 2022, 19:26

Hello. Found the following problem. I set the minimum order amount in the specified plugin to $25. And added a 10% discount on all products.
Now, when placing an order, I need to add goods not for $25, but for $25 + 10% to be able to place an order.
The order amount and discounts are stored in an instance of the Basket class.
The sum is returned by $this->summaryBasket->getPrice()->getValue()
The discount is returned by $this->summaryBasket->getPrice()->getRebate()
Judging by the logic of the cart, the discount has already been taken into account in the order amount (getPrice()->getValue()).

https://github.com/aimeos/aimeos-core/b ... s.php#L192

In this method, the limit is compared with the order amount + discount:
$sum->getValue() + $sum->getRebate() < $config['min-value'][$currencyId]

And there should be only the amount of the order. Or am I misunderstanding how the basket works?

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

Re: BasketLimits plugin problems

Post by aimeos » 27 Oct 2022, 11:34

Yes, discounts should be taken into account.
Do you know where the underlying problem is located? The basket plugin seems to work correctly by adding price + rebates.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
РоманАндрейчук
Posts: 18
Joined: 13 Jan 2022, 15:08

Re: BasketLimits plugin problems

Post by РоманАндрейчук » 02 Nov 2022, 08:23

Maybe, I know what's up. I have overridden the following method (calcPrice) for my new Basket/Standard class:
https://github.com/aimeos/ai-controller ... se.php#L31

change return from:
return $price->setRebate( '0.00' );
to:
return $price;

I did this in order to be able to display the total discount for the cart. The discount was not visible after adding a 10% discount on all products.

Post Reply