fbpx
Want To Add Extra Images Per Product Variation? Download This Free Plugin

he function of selecting a photo by color does not work

Hello, I have installed the woo-variation-swatches-pro plugin, but the photo change by clicking on the color does not work, that is, when you select a color, the photo does not change. I have a Minimog theme, but when I change the theme it works, but I need it on this theme for which I paid. I also bought the pro plugin from you!!!

Hakik Zaman

Hi Maksym,

Thanks for reaching out to us.

Please make sure your theme has any gallery features or not. If your theme has a gallery feature, please disable the theme-built gallery and enable the WooCommerce default gallery.

If your theme didn’t provide a visual option to enable the default gallery, please contact theme support and ask them to do it for you.

Note: The ‘Single Variation Image Preview’ feature is an extension of the default WooCommerce gallery. It will not work with your theme-built gallery. Because there are several themes with different gallery structures. It is not possible to make it compatible with each. That’s why we extended the default WooCommerce Gallery.

Hope to hear from you soon!

Thank You

pasted this code into the function but still does not work changing the color of the photo

Hakik Zaman

Hi Maksym,

I haven’t asked you to paste the code, I gave you it as a reference that other theme provides this.

Thank You

[***] Added to the login details area

————————————————-

function disable_minimog_gallery_force_wc() {
// Повністю вимикаємо галерею Minimog
remove_action( ‘woocommerce_before_single_product_summary’, ‘Minimog_Woo::single_product_gallery’, 5 );
remove_action( ‘woocommerce_before_single_product_summary’, ‘Minimog_Woo::single_product_thumbnail_gallery’, 10 );

// Вимикаємо стилі та скрипти галереї Minimog
add_action( ‘wp_enqueue_scripts’, function() {
wp_dequeue_style( ‘minimog-product-gallery’ );
wp_dequeue_script( ‘minimog-product-gallery’ );
}, 99 );

// Додаємо стандартну галерею WooCommerce
add_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_show_product_images’, 20 );

// Увімкнення всіх функцій галереї WooCommerce
add_theme_support( ‘wc-product-gallery-zoom’ );
add_theme_support( ‘wc-product-gallery-lightbox’ );
add_theme_support( ‘wc-product-gallery-slider’ );
}
add_action( ‘after_setup_theme’, ‘disable_minimog_gallery_force_wc’, 99 );

Hakik Zaman

Hi Maksym,

Unfortunately, your added snippet doesn’t load the default WooCommerce Gallery.

Because your theme also changed the markup of the gallery- https://paste.pics/c48c17681503872c9c38382104b68932

So, I have installed our Gallery plugin to replace the theme gallery template.

Now it is working like this- https://www.loom.com/share/09f274db92e64f23a7cd1034cb56b4dd

Please check now and don’t forget to flush your caches (browser cache, caching plugin cache, and server-side cache) before checking.

Thank You

Hakik Zaman

Hi Maksym,

Please share a screenshot to unsderstand your issue clearly.

I recommend https://paste.pics  for easily sharing screenshots – please follow the instructions on that page, then paste the screenshot’s sharable URL in this thread.

Hope to hear from you soon.

Thank You