• Resolved paolotome82

    (@paolotome82)


    Hi,
    I have a problem when I select a variant on the product page from mobile: the relative image is not selected.

    By disabling the plugin and selecting the variant from the drop-down menu, the image is selected correctly.

    The problem does not occur on related products (on the same page) or on the shop page.

    Error form debug console:

    Uncaught TypeError: i is null
        wc_variations_image_update https://xxxxx/wp-content/themes/blocksy/static/bundle/16.77acfd70b6fcd8af9bf0.js:1
        onFoundVariation https://xxxxx/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js?ver=6.4.1:1

    Thank you for any advice you will give me
    Paolo

Viewing 1 replies (of 1 total)
  • Thread Starter paolotome82

    (@paolotome82)

    I solved the problem by editing:
    /wp-content/themes/blocksy/static/bundle/16.77acfd70b6fcd8af9bf0.js file.

    I replaced:
    const i = e.closest(".product").querySelector(".woocommerce-product-gallery");

    with:

    var id_art = document.querySelector('.status-publish').getAttribute('id');
    e = document.querySelector("#"+id_art+" .variations_form");
    const i = e.closest(".product").querySelector(".woocommerce-product-gallery");

    thanks
    Paolo

Viewing 1 replies (of 1 total)
  • The topic ‘Swatches not changing image on mobile’ is closed to new replies.