Adding new image gallery functionality for WooCommerce theme

Product image is one of the most important parts of your e-commerce website. A customer always wants to check the product image and then decide to go for the next step. Now, if your website does not have any option to allow the customer to view the image correctly then you are not doing good.

I know you will search for image zoomer plugin for WooCommerce to use on your website. There are lots of image zoomer plugin available. Now, I want to inform you something very important and surprising news. Do you want to get some extraordinary gallery functionality on your website without any plugin? If yes, then this post is for you.

How can I get gallery functionality without a plugin?

WooCommerce plugin already redesigned their product image gallery functionality from the latest version 3.0. Now, the gallery functionality support is built-in in WooCommerce.

This is a significant frontend change that can be broken down into three separate new features;

  • Image zoom / magnification
  • Lightbox
  • Slider

You do not have to install any plugin because you can get those functionalities easily by adding that functional support through your theme.

Most of the theme already added the gallery support on their theme after releasing WooCommerce v3.0. Now, if your theme does not have the gallery support by default then you can easily add the gallery support.

To enable each of these features in your theme you must declare support using add_theme_support() like so;

add_action( 'after_setup_theme', 'yourtheme_setup' );

function yourtheme_setup() {
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );

This allows you the flexibility to pick and choose exactly which features you want to include/exclude in your theme or at your store.


2 thoughts on “Adding new image gallery functionality for WooCommerce theme

Leave a Reply

%d bloggers like this: