Home Forums WoodMart support forum Variation Image Gallery issue

Variation Image Gallery issue

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #402285

    dadi
    Participant

    Hello,

    I have a issue with the variation image gallery. On my products I both have color and size and variation image/gallery on the variations.

    When I start by changing the color the main image only changes if size is not selected.

    I would like it to be so if I change the color it checks the first size in this color and uses the image gallery and if it’s empty it uses the featured images of the product.

    Attachments:
    You must be logged in to view attached files.
    #402314

    Hello,

    Please provide the URL of the product to check it myself and help you out accordingly.

    Best Regards

    #402330

    dadi
    Participant

    Hello,

    I fixed the issue by adding little jquery code:

    <script>
    (function($){
    	$(document).ready(function(){
    		let isRunning = false;
    		$('.variable-item').click(function(){
    				if(isRunning) return;
    				let element = $(this);
    				window.setTimeout(function(){
    				let el = element.parents('tbody');
    				let classnames = element.attr('class');
    				$(el).find('tr').each(function(){
    						let sel = $(this).find('li.selected:first');
    						let doubleClick = true;
    						if(!sel.length){
    								sel = $(this).find('li:not(.disabled):not(.no-stock):first');
    								doubleClick = false;
    						}
    						if(classnames !== sel.attr('class')){
    								isRunning = true;
    								sel.click();
    								if(doubleClick){
    										sel.click();
    								}
    								window.setTimeout(function(){
    										isRunning = false;
    								},500);
    						}
    				});
    				},500);
    		});
    });
    })(jQuery);
    </script>
    #402438

    Hello,

    We are Glad that your issue has been Resolved.

    Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.

    Have a wonderful day.

    Topic Closed.
    Best Regards.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Variation Image Gallery issue’ is closed to new replies.