Home › Forums › WoodMart support forum › Image Swatches not applying on product
Image Swatches not applying on product
- This topic has 12 replies, 2 voices, and was last updated 1 year, 3 months ago by Luke Nielsen.
-
AuthorPosts
-
July 18, 2023 at 5:20 pm #482426
ahmed.skatessportsParticipantHi, I have added image swatches to a variable product from attributes. This product has 6 total swatches (2 color swatches & 4 Image swatches).
Problem:
When no product image is added to the variation swatches look fine as they should, as soon as I add product images to my variations, the color swatches work perfectly but image swatches fetch “images of the product” that I uploaded from the product backend, instead of “swatch images” that I uploaded from the attribute.All the screenshots are attached below, please read the descriptive image caption for your understanding.
ThanksAttachments:
You must be logged in to view attached files.July 19, 2023 at 9:52 am #482538
Luke NielsenKeymasterHello,
You can disable those images for swatches that were chosen for variation via Theme Settings -> Shop -> Variable products -> turn off the “Use images from product variations” option.
Let me know if you have any questions or concerns.
Kind Regards
July 19, 2023 at 3:40 pm #482663
ahmed.skatessportsParticipantThanks,
Another problem am facing is, if I set “swatch image from attributes” as you can see in the above screenshots, the product will “fetch this image from this specific attribute” but it’s not useful if I wanted to use the “same attribute for different product”.For example: If I created an attribute named “color” and add “image for black color” to product 1, If I wanted to use the same black color from this “color attribute” to product 2, the same image swatch of product 1 will display on product 2 also which I don’t want.
Another possible way can be creating a new attribute but I can’t create another attribute of the same name “color” as I created in the above example, which is also not a practical solution.
July 20, 2023 at 12:48 pm #482915
ahmed.skatessportsParticipantI was going to apply another alternative solution to the above problem I discuss:
The alternative solution:
In order to make the image swatches have unique images, doesn’t matter if the attribute name or item is same, to achieve it, I was going to turn on the “Use images from product variations” option from settings.but to let image swatches use images from product variation, We must upload the demo image to image swatch option (https://monosnap.com/file/99HzYs0E8lv4IaRPFqORIv2zpaCDoB), Which I don’t get. There should be an option to just turn it on or off.
After adding demo image it shows product variation image on single product page, but on the shop page or on related products it shows the demo image which we uploaded on image swatch just to enable this option. (https://monosnap.com/file/AIn0QLrY5aL8BzAd99Dk2x8T1aLV85)
July 20, 2023 at 4:42 pm #483002
Luke NielsenKeymasterHello,
In order for the “Use images from product variations” option to work, either “Image swatch” or “Text swatch” should be selected in each attribute, and an attribute should be selected in the “Grid swatch attribute to display” option in Theme settings. It has such work.
Kind Regards
July 21, 2023 at 5:14 pm #483294
ahmed.skatessportsParticipantSo why it does not show “the images used from product variations” on the collection page products or in related products? (https://monosnap.com/file/AIn0QLrY5aL8BzAd99Dk2x8T1aLV85)
Meanwhile, it shows “the images used from product variations” on the single product page. Why not same results on both the collection and single product pages?July 24, 2023 at 10:35 am #483678
Luke NielsenKeymasterHello,
At the moment, on your website for this product, this option is turned off, and we cannot check what is wrong there, because we do not have access, so could you please send access to the admin dashboard?
Looking forward to collaborating with you!
Kind Regards
July 25, 2023 at 3:45 pm #484057
ahmed.skatessportsParticipantHello,
The scenario I wrote above was after trying every option from Woodmart. I write detailed description of the case so you can understand all the aspects. You can check it by yourself too by creating a draft product.
Find the login details below, Thanks
July 26, 2023 at 12:10 pm #484254
Luke NielsenKeymasterHello,
Sorry for the delay.
Could you please give me full access? Because at the moment, it seems that the access is limited: https://take.ms/DnBPSK
Kind Regards
July 27, 2023 at 1:45 pm #484556
ahmed.skatessportsParticipantI give you full administrator access.
Please check now and help me resolve it ASAPJuly 27, 2023 at 3:35 pm #484588
Luke NielsenKeymasterHello,
You use Quick shop On variation click, because of this, for variations that have more than 1 attribute, the product data is not loaded, this is done for performance, because of this, images from variations are not loaded, so in order to show all images, add this custom code to the child theme and check.
add_action( 'woodmart_variation_attributes_on_grid', function ( $count ) { global $product; return count( $product->get_variation_attributes() ); });
Kind Regards
July 28, 2023 at 2:43 pm #484866
ahmed.skatessportsParticipantis it going to affect the performance of my website?
If yes, then to what extent it will affect it?because performance is the first priority
July 28, 2023 at 2:52 pm #484868
Luke NielsenKeymasterHello,
We cannot tell you exactly how this code will affect the performance of your site, because there are many factors that affect it. Check how it will work with and without custom code.
Kind Regards
- This reply was modified 1 year, 3 months ago by Luke Nielsen.
-
AuthorPosts
Tagged: image swatches
- You must be logged in to create new topics. Login / Register