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)
#2079 by franzrudolf
23 Nov 2015, 14:51
Hi,

putting a selection-article into the basket, the image in the basket doesn't show the media-file of the chosen variant but the first media-file of the selection-element. Given that the chosen color is different to the one in the pic this is very confusing. Is there an option to show the media-file of the respective variant instead?

Thank you very much for your help (and excuse my poor English).
Ralph
#2080 by aimeos
23 Nov 2015, 15:38
franzrudolf wrote:putting a selection-article into the basket, the image in the basket doesn't show the media-file of the chosen variant but the first media-file of the selection-element. Given that the chosen color is different to the one in the pic this is very confusing. Is there an option to show the media-file of the respective variant instead?


Product variant images are not yet added to the basket items. The first image of the selection product is used because of this line in the code: https://github.com/aimeos/aimeos-core/blob/master/controller/frontend/src/Controller/Frontend/Basket/Standard.php#L99.

To use images assigned to product variants, here (https://github.com/aimeos/aimeos-core/blob/master/controller/frontend/src/Controller/Frontend/Basket/Standard.php#L1092) the same should be done to assign the correct image like there: https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Order/Item/Base/Product/Standard.php#L678

A pull request changing this behavior is welcome :-)