1
votes

My WooCommerce theme has a custom gallery that is coded directly into single-product.php. Rather than using this custom gallery, I wish to display images on the product screen with the original default Woo Commerce gallery.

The files in the plugin that I believe display the default gallery are:

  • product-image.php
  • product-thumbnails.php

I'm new to server side programming and PHP. I've tried the following code:

<?php wc_get_template_part( 'content', 'product-images' ); ?>
<?php wc_get_template_part( 'content', 'product-thumbnails' ); ?>

But this doesn't return anything.

How do revert to the original WooCommerce gallery when my theme has an image gallery hard coded into single.php?

1

1 Answers

1
votes

In your case it seems that your theme has custom woocommerce templates files inside it. The trick could be trying replace some of those templates files, by the original ones. The better way to do that is to set a child theme, avoiding theme updates problems…

1) If you are using a child theme:

  • Copy the woocommerce folder located in your parent theme to your child theme.
  • Replace from the woocommerce plugin, templates folder, the needed templates files to the woocommerce folder inside your active child theme.

2) If you are not using a child theme, Just replace from the woocommerce plugin, templates folder, the needed templates files to the woocommerce folder inside your active theme.

Reference: Overriding Templates via a Theme