
Fix custom themed WooCommerce Gallery
- or -
Post a project like this654
£30/hr(approx. $40/hr)
- Posted:
- Proposals: 50
- Remote
- #4122070
- Awarded
WordPress | Shopify | WooCommerce | Elementor | Divi | Page Speed | Malware Removal | Laravel | React | Next.js | SEO Optimization

Quick Graphic Designer + Animator + Video Editor + Photo Editor + Logo Designer + Autocad Designer

Top-Rated Web & Graphic Designer | Database Expert | Business Analysis| Python Developer


Executive Virtual Assistant| IT Consultant | graphics| | Website design | social media management .

⭐ TOP CERT Graphic Designer ⭐| Expert 2D/3D Render | Video Animator | Web Developer |Logo Designer |Graphic Animations | Video Editor ||Illustration.

WORDPRESS ( WOOCOMMERCE AND PLUGIN) AND CMS EXPERT - QUICKEST DELIVERY GURANTEED 12 + YEARS

⭐ TOP CERT WordPress Developer | WordPress Design | Website Creation | Custom Web Design | Figma to Elemontor | Squarespace

266511464769061021796920989669487324599143431591984901021337601070355815684522499006





Description
Experience Level: Expert
I have a site that I'm building on WordPress. It's got a Woocommerce store but I'm having issues with the product gallery. When I click the gallery image it doesn't load that image in the main image space.
You can see what I mean here - https://wbs.mhwddev.co.uk/product/bsc3/
I've tried with the following code but it doesn't seem to work.
jQuery(document).ready(function($) {
$('.woocommerce-product-gallery__wrapper').on('click', 'a', function(e) {
e.preventDefault();
var imageUrl = $(this).find('img').attr('data-src');
console.log(imageUrl);
$('#main-image img').attr('src', imageUrl);
});
});
You can see what I mean here - https://wbs.mhwddev.co.uk/product/bsc3/
I've tried with the following code but it doesn't seem to work.
jQuery(document).ready(function($) {
$('.woocommerce-product-gallery__wrapper').on('click', 'a', function(e) {
e.preventDefault();
var imageUrl = $(this).find('img').attr('data-src');
console.log(imageUrl);
$('#main-image img').attr('src', imageUrl);
});
});

Michael H.
100% (9)Projects Completed
9
Freelancers worked with
7
Projects awarded
92%
Last project
9 Dec 2024
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
Hi Michael,
Have you managed to resolve this now?
As the other developer has pointed out, it's not the best code implementation to be honest as it won't change the responsive image HTML code.
Is there a particular reason why you decided to not just use the default WooCommerce gallery and just disable the features of the gallery that you didn't want...? Ie. zoom etc.?
Kind regards,
Matthew -
Hello Michael,
Have you tried any better gallery plugins for this? I have checked the js you are using and only changed the src but the image tag has srcset which defines different image formats for different screen sizes.
10825071082479
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies