Product media depends on selected attribute

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!
MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Product media depends on selected attribute

Post by MikaelNazarenko » 03 Nov 2021, 21:57

Hello, Aimeos !

I have attribute "color", I have attached some colors to product as configurable options. So on FE product detail page I can select specific color. But when I select specific color I would like to show specific media related to selected color and hide other..

Is there some solution for that ?

Thanks a lot!

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

Re: Product media depends on selected attribute

Post by aimeos » 05 Nov 2021, 07:28

Currently, your attributes must be variant attributes to make that work. For regular attributes, the attribute IDs are not automatically attached to the images. If you change "variant" to NULL here it may already work:
https://github.com/aimeos/ai-admin-jqad ... d.php#L257

If yes, please create a pull request so we can merge the change into the core :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Re: Product media depends on selected attribute

Post by MikaelNazarenko » 10 Nov 2021, 14:37

Hi Aimeos!

Sorry but for me it is not clear. I figured out how it works with variant attributes - for this I create selection product and add variant products and add attributes to variant products.

But how can it work with one simple product ? I think I have to set the color to each image.. but how ?



Thank you !

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

Re: Product media depends on selected attribute

Post by aimeos » 12 Nov 2021, 07:48

In fact, it's a bit more complicated and you are right, you have to associate the configurable attributes to the uploaded images somehow. One way would be to extend the "options" subpart of the product panel and add the attributes to the images there. The main problem is that you don't know which attribute belongs to which image.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply