Tagged: x
-
AuthorPosts
-
March 10, 2017 at 8:18 am #1401912
jcarnascialiParticipantHey guys,
As always, I’ll start my question by saying: great theme! This is the sixth license I got so far.
I’m currently developing an eCommerce for a client, and I’m having some trouble with the single-product page of Woocommerce adapted to X.
When I create an image gallery for a specific product, by clicking the thumbnails on the product page, I’m being redirected to that img URL (wp-content/uploads/etc etc…) rather than the image just being shown on the “featured image” over the thumbnail, which is default for ecommerces, and I’d like to change that. I’ve checked that X has edited templates of product-images.php and product-thumbnails.php on its files, so I guess that could be fixed there, but since I have little to no knowledge of php, I have no clue how to do that. Could you guys help me?
Here is one example of the problem: https://gurilifestyle.com/product/vizzano-white/, clicking on the thumbnails open the URL of the image rather than just changing the featured image.
Thank you!
March 10, 2017 at 2:47 pm #1402308
jcarnascialiParticipantHey Guys,
I already figure out how to do it, after some research on stackoverflow. Wow, I really thought that was a basic function of Woocommerce! Like, 90% of ecommerce sites use it.
Anyway, for anyone who needs it, here’s the code:
jQuery('.thumbnails .zoom').click(function(){ var photo_fullsize = jQuery(this).find('img').attr('src').replace('-100x132',''); jQuery('.woocommerce-main-image img').attr('src', photo_fullsize); return false; });Quoting the author, “.replace(‘-100×132’) eliminates the size from url of the image to return the full image and not the thumbnail. Replace it with your own thumbnails sizes.”
Cheers
March 10, 2017 at 3:20 pm #1402338
Nabeel AModeratorGlad you’ve sorted it out and thank you for sharing the solution with us. I’m sure this will help others as well.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1401912 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
