How to configure and adapt Aimeos based shops as developer
Forum rules: Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#3731 by Pejka
12 Dec 2016, 13:05
Hello!
Is there any setting so that whenever someone adds a product to the basket that's already in the basket, or increases the amount of it, it doesn't increase the quantity but adds a different entry to the basket? In other words, I need a basket that doesn't aggregate the same products into a single line / value, but stores every item separately.
Thanks,
Máté
#3732 by aimeos
13 Dec 2016, 10:06
Currently, the same products with the same attributes are merged together due to
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Order/Item/Base/Base.php#L170

It would be possible to add a parameter like "$merge" (true/false) and pass a new option to addProduct() in the Basket controller:
https://github.com/aimeos/ai-controller-frontend/blob/master/controller/frontend/src/Controller/Frontend/Basket/Standard.php#L98

If the basket should contain only products with a quantity of one (several times), you have to overwrite the editProduct() method:
https://github.com/aimeos/ai-controller-frontend/blob/master/controller/frontend/src/Controller/Frontend/Basket/Standard.php#L172