Home Forums WoodMart support forum Image Swatches not applying on product

Image Swatches not applying on product

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #482426

    ahmed.skatessports
    Participant

    Hi, 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.
    Thanks

    Attachments:
    You must be logged in to view attached files.
    #482538

    Luke Nielsen
    Keymaster

    Hello,

    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.

    https://take.ms/DXO86

    Let me know if you have any questions or concerns.

    Kind Regards

    #482663

    ahmed.skatessports
    Participant

    Thanks,
    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.

    #482915

    ahmed.skatessports
    Participant

    I 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.

    https://take.ms/DXO86

    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)

    #483002

    Luke Nielsen
    Keymaster

    Hello,

    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.

    https://take.ms/WECwZ

    Kind Regards

    #483294

    ahmed.skatessports
    Participant

    So 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?

    #483678

    Luke Nielsen
    Keymaster

    Hello,

    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

    #484057

    ahmed.skatessports
    Participant

    Hello,

    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

    #484254

    Luke Nielsen
    Keymaster

    Hello,

    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

    #484556

    ahmed.skatessports
    Participant

    I give you full administrator access.
    Please check now and help me resolve it ASAP

    #484588

    Luke Nielsen
    Keymaster

    Hello,

    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

    #484866

    ahmed.skatessports
    Participant

    is 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

    #484868

    Luke Nielsen
    Keymaster

    Hello,

    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.
Viewing 13 posts - 1 through 13 (of 13 total)