Basket: add same product
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Basket: add same product
Hi Aimeos-Team!
I want to add a product multiple to basket without add the quantity of the order item, but add a new order item.
The reason are designable products within an external editor.
So far I´ve extended the \Aimeos\MShop\Order\Item\Base\Product\Standard with my own impl. with a new column to save the "designable" parameters from the external editor. (https://aimeos.org/docs/latest/models/extend-managers/)
Now I look into the code Aimeos\MShop\Order\Item\Base\Base::addProduct and ::getSameProduct
and there are "getAttributeItems". Can we add attributes to an order-item during the "addProduct" or is these the original attributes from the product? Now I am confused with the extending the manager/item above.
Thx a lot!
Ralf
I want to add a product multiple to basket without add the quantity of the order item, but add a new order item.
The reason are designable products within an external editor.
So far I´ve extended the \Aimeos\MShop\Order\Item\Base\Product\Standard with my own impl. with a new column to save the "designable" parameters from the external editor. (https://aimeos.org/docs/latest/models/extend-managers/)
Now I look into the code Aimeos\MShop\Order\Item\Base\Base::addProduct and ::getSameProduct
and there are "getAttributeItems". Can we add attributes to an order-item during the "addProduct" or is these the original attributes from the product? Now I am confused with the extending the manager/item above.
Thx a lot!
Ralf
Re: Basket: add same product
I checked out the compare-Funktion in Aimeos\MShop\Order\Item\Base\Product\Standard and added my new column in my own implementation to the compare-condition and it worked.
Re: Basket: add same product
Instead of storing the design parameters in an additional column, you can also store them in a custom product attribute. Then, products in the basket are also not merged together when they have different attribute values.
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