BasketLimits plugin problems
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!
- РоманАндрейчук
- Posts: 18
- Joined: 13 Jan 2022, 15:08
BasketLimits plugin problems
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?
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?
Re: BasketLimits plugin problems
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.
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, give us a star
If you like Aimeos, give us a star
- РоманАндрейчук
- Posts: 18
- Joined: 13 Jan 2022, 15:08
Re: BasketLimits plugin problems
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.
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.