• 230 Views
  • 0 comment
  • Print

WooCommerce v.3.0 (Bionic Butterfly) released a brand new image gallery which requires you to add theme support before it gets fully functional. So, if you are installing WooCommerce v3.0 or higher on your site and did not add the theme support, the first thing you will notice that the Product Image Gallery on single product page is not working properly.

Back in October 2016, a warning message was posted on WooCommerce’s official blog site. But I am sure like always many of us may have missed that post and now looking for the solutions. So, if you are using a theme from a third party company or a custom made one, you should not miss this post.

New Image Gallery Demonstration
In order to support the new WooCommerce Product Gallery on your site, simply copy and paste the following snippet on your theme’s functions.php page and update it accordingly. Your site’s product image gallery should be working as it expected. Here is the snippet.

add_action('after_setup_theme','custom_theme_gallery_support');
function custom_theme_gallery_support() {
   add_theme_support('wc-product-gallery-zoom');
   add_theme_support('wc-product-gallery-lightbox');
   add_theme_support('wc-product-gallery-slider');
}

Now simply go back to the front-end of your site and refresh your single product page.

Background: There was suppose to be WooCommerce v2.7, at least that was the plan. However, somehow that plan was scrapped and it never saw the daylight. WooCommerce v.3.0 was released renaming v2.7.