WooCommerce 3.0 Image Gallery Fix
WooCommerce 3.0 introduced some great new features for your WooCommerce photos — including image zoom/magnification, mobile design improvements, a new and improved lightbox, and an image gallery slider. That's the good news! The bad news... this update also disabled all of those new image features by default, so you may notice that your images now open in the browser instead of in a lightbox like they used to.
To restore lightbox functionality, you'll just need to add a bit of code to your theme. Go to Appearance > Editor > Theme Functions (Functions.php). Paste the following code at the very bottom, and then click Update File.
Please note that if you are using an older version of WooCommerce, you must update to 3.0 or later before adding this code.