My client has several products – and each of them have a few images. We want the images that appear in the Product Gallery to appear in the Product Image container when the user either clicks or hovers on the gallery items.
I think WooCommerce enabled this feature with their 2.7 update in late 2016? It’s not working with the Newspaper theme though. Or, I’m missing something obvious.
Help!
-
This topic was modified 8 years by
cantonjester.
Hi,
There were changes to the functionality of the way products display, I believe in version 3 of the plugin. You will have to add the code mentioned in this topic, in the main theme (or child theme) functions file
– https://github.com/woocommerce/woocommerce/wiki/Enabling-product-gallery-features-(zoom,-swipe,-lightbox)-in-3.0.0
This will produce the result you need, clicking on the gallery images will display the images as the product image
– https://www.screencast.com/t/qwSeUaVcX21
– https://www.screencast.com/t/z5yeSzsW
Thanks
I followed those instructions, and then realized that the lightbox checkbox I needed to activate wasn’t available in WooCommerce Product Display settings.
So I added the following snippet of code to the Child Theme’s function.php file:
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' );
}
I adjusted the ‘yourtheme’ to ‘newspaper’. Please let me know what this needs to be if that’s not accurate.
It broke the site. I’m now getting the following error:
Parse error: syntax error, unexpected ‘3’ (T_LNUMBER) in /home/robywebd/public_html/cet/wp-content/themes/Newspaper-child/functions.php on line 31
What do I do to fix this?! I tried removing the code, clearing the cache, etc. The error still persists.
HELP.
I contacted SiteGround. Apparently the code found on this site embedded the line numbers when I copied the snippet.
I manually entered the code and then it works as expected.
Question: the WooCommerce zoom feature is rather difficult to use. Is there a known conflict with the theme? Is there an existing zoom feature I might have to disable? Because as it stands, I just removed the line of code in that snippet that enables the zoom functionality. The image juts around, and apparently starts off on page refresh relative to wherever your mouse is on the screen, which is obviously not an intended effect.
-
This reply was modified 8 years by
cantonjester.
Hi,
There should be no conflict with that Woocommerce feature, the theme does not have a similar option. If it is no working properly, disable it by removing the code that enables it. Maybe it is a known issue, they might fix it if that is the case.
There could be other plugins that you can use in this matter, if a magnifier option is required.
Thanks