Fix Divi Theme’s Horrible WooCommerce Gallery With Simple code: remove_theme_support
Not liking Divi's usage of WooCommerce's new single product gallery features? Me neither. By default Divi adds support for all three of WooCommerce's new gallery features: zoom, lightbox and slider. For some this is great, but for real life things hazing all three together doesn't work as well as you'd like.
So here's how to remove ‘support' from Divi for all three new gallery functions:
add_action( 'after_setup_theme', 'remove_too_much_woo', 11 );
remove_theme_support( 'wc-product-gallery-zoom' );
remove_theme_support( 'wc-product-gallery-lightbox' );
remove_theme_support( 'wc-product-gallery-slider' );
No realistically you'll probably want to use one, none, or a combo … so just comment out the functions you want to keep (or remove the line of code).
To make the code above work just toss in into your child theme's functions.php file.
For us, I mostly just remove the zoom feature while keeping the other two.
Very important note: I've been asked this before and why it wasn't working for people, make sure to keep the `remove_theme_support' code INSIDE the action function. Just having ‘remove_theme_support' normally inside the functions.php file will NOT work. That function NEEDS to be called from an action.
Here's the WordPress documentation about this function: https://codex.wordpress.org/Function_Reference/remove_theme_support