Product table image options
If you use the
image column in your table, the image will open in a lightbox when someone clicks on the image.
The lightbox uses the Photoswipe library which has been included as part of WooCommerce since version 3.0. (Note: if you’re using an older version of WooCommerce, the lightbox will not work.)
The lightbox is enabled by default. If you would like to disable the lightbox feature, you can untick the option in the plugin settings page:
You can also enable or disable it for individual tables by setting the lightbox option in the shortcode:
Can I change or restyle the image lightbox?
The lightbox uses the Photoswipe library which comes with WooCommerce itself. Unfortunately there are no options to customize this (e.g. to change the lightbox background colour), and you could do this by adding some custom CSS. If you don’t know how to do this, we recommend that you post a job on Codeable to find a suitable WordPress developer. We have partnered with them to provide customizations for our customers.
Can I show the full product image gallery in the lightbox?
The image lightbox that comes with WooCommerce Product Table only shows the main product image. If you would like people to be able to click on the image in the table to open a lightbox containing the full image gallery, then you would need to use WooCommerce Product Table with our dedicated lightbox plugin – WooCommerce Quick View Pro.
You can use WooCommerce Quick View Pro to link the image column of the product table to a lightbox popup containing multiple images of each product (either displayed as clickable thumbnails or bullet navigation). You can also choose whether or not to show product information and add to cart buttons in the lightbox.
Here are some screenshots showing how you can display the product image gallery in a Quick View Pro lightbox.
Linking to the product page from the image column
If you would like the image to be clickable and take the user to the single product page, you need to disable the lightbox as described above. Once you’ve done this, the image column will instead link to the relevant single product page – see the links article for more details.
image_size option controls the size of the image column if you have included this column in your product table.
The default image size is
70x70. You can use any standard image size (e.g. thumbnail, medium, large, etc), or one or two numbers to denote the width and height for the image.
You can either set the image size option globally on the plugin settings page, or add it directly to the shortcode for individual product tables.
For example, to use the
medium image size:
[product_table columns="image,name,description" image_size="medium"]
For a square image 50 by 50 pixels:
[product_table columns="image,name,description" image_size="50"]
For an image 40 pixels wide by 60 pixels high:
[product_table columns="image,name,description" image_size="40x60"]
My images are the wrong size!
Image sizing is very complex in WordPress, and can have unexpected results.
A few tips:
- Your images must be the correct proportion for your chosen image size. For example, if your images are square and you set
image_size="50x40"then the images will still appear square.
- If you’re using the built-in image sizes (e.g. thumbnail, medium or large) then you can check their sizes in Settings > Media.
- It’s possible that the width settings (see above) may be overriding your image sizes. For example, if you have set a fixed width for the image column and a specific image size then these options may conflict.
- If you’re really struggling to get your images the correct size in the table then you can resize the original image to the correct size.
- If your images are being displayed or shown in the wrong size or aspect ratio, despite ensuring the correct image settings or proportions, this can sometimes be due to your theme’s image settings that override the plugin’s settings and cause images in your product table to be cropped in unexpected sizes. To test for this, temporarily switch to a default WordPress theme (e.g. Twenty Seventeen) and check if the issue with images persists. If it doesn’t, then browse your theme’s settings for its own settings for image sizes or cropping. An example of this is the Flatsome theme, which has its own setting for custom image ratio.
How to remove images from the table
If you don’t want to include images in the product table at all, then you can delete the image column from your list of table columns. Please see the documentation about how to edit the columns in the table.