Image not changing with Variant Selection
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: 12
- Joined: 19 Apr 2024, 18:29
Image not changing with Variant Selection
When I choose a variant, the corresponding image doesn't change.
In my case variant attribute is color.
Price is changing but image isn't.
Additionally, I'd like to inquire whether a main product without an assigned image will automatically fetch the variant image or not?
Laravel 11.4.0
Aimeos 2024.4
PHP 8.3.6
Ubuntu 20.04.3 LTS
In my case variant attribute is color.
Price is changing but image isn't.
Additionally, I'd like to inquire whether a main product without an assigned image will automatically fetch the variant image or not?
Laravel 11.4.0
Aimeos 2024.4
PHP 8.3.6
Ubuntu 20.04.3 LTS
Re: Image not changing with Variant Selection
Tested that and works as expected. Did you upload the images for the variant articles in the admin backend? The variant attributes need to be assigned to the uploaded images and the admin backend does that automatically. For imported articles, this isn't the case.syedaliiftikhar wrote: ↑29 Apr 2024, 17:01 When I choose a variant, the corresponding image doesn't change.
In my case variant attribute is color.
Price is changing but image isn't.
No, due to performance reasons.syedaliiftikhar wrote: ↑29 Apr 2024, 17:01 Additionally, I'd like to inquire whether a main product without an assigned image will automatically fetch the variant image or not?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 12
- Joined: 19 Apr 2024, 18:29
Re: Image not changing with Variant Selection
"The variant attributes need to be assigned to the uploaded images and the admin backend does that automatically. "
Could you please provide further details or perhaps a demo video regarding the process you mentioned?
I'm utilizing ai-woocommerce, so if it's not automatically being acquired, I assume I'll need to take additional steps. Could you share more information, such as an SQL query for accomplishing this task, or specify which manager is responsible for it and which table it's linked to?
Could you please provide further details or perhaps a demo video regarding the process you mentioned?
I'm utilizing ai-woocommerce, so if it's not automatically being acquired, I assume I'll need to take additional steps. Could you share more information, such as an SQL query for accomplishing this task, or specify which manager is responsible for it and which table it's linked to?
Re: Image not changing with Variant Selection
The relevant code in the admin interface is available here:
https://github.com/aimeos/ai-admin-jqad ... #L244-L259
In the migration scripts, the code for assigning variant attributes to products is here:
https://github.com/aimeos/ai-woocommerc ... #L191-L192
When assigning the images to the products, the variant attributes of the products should be also assigned to the media items here too:
https://github.com/aimeos/ai-woocommerc ... #L335-L341
You can get the variant attributes of a product using:
https://github.com/aimeos/ai-admin-jqad ... #L244-L259
In the migration scripts, the code for assigning variant attributes to products is here:
https://github.com/aimeos/ai-woocommerc ... #L191-L192
When assigning the images to the products, the variant attributes of the products should be also assigned to the media items here too:
https://github.com/aimeos/ai-woocommerc ... #L335-L341
You can get the variant attributes of a product using:
Code: Select all
$listItems = $product->getListItems( 'attribute', 'variant', null, false );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Image not changing with Variant Selection
We've added the necessary code to the migration but are not able to test it at the moment:
https://github.com/aimeos/ai-woocommerc ... 9b8062b968
Can you check if it does the job now?
https://github.com/aimeos/ai-woocommerc ... 9b8062b968
Can you check if it does the job now?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 12
- Joined: 19 Apr 2024, 18:29
Re: Image not changing with Variant Selection
Actually I have customized that script for my own need. This code was missing and yesterday I figured that out.
I will say yes It is working. As it worked for my script, it will work for ai-woocommerce as well.
I will say yes It is working. As it worked for my script, it will work for ai-woocommerce as well.