-
AuthorPosts
-
May 31, 2017 at 4:55 pm #802098
Hi,
I try to follow every step to make a product with 6 variables, but when the product has the main image, the 6 variable (once selected) does not change the image. If the main image is removed, the variable shows its own image.
I have to wait for a update of enfold or woocommerce?-
This topic was modified 8 years, 5 months ago by
MarcoCianetti.
June 1, 2017 at 4:29 pm #802639I did a test with another site with different template and it works correctly.
So the problem is enfold not woocommerce.
Do I need to change the settings?
Add css?June 1, 2017 at 4:47 pm #802652Hi,
Can you please try adding following code to Functions.php file in Appearance > Editor
function av_variation_product_image(){ ?> jQuery(window).load(function(){ jQuery('select:first').change(function(){$name=this.name;$variation=jQuery(this).val(); if($variation!==''){ $productVariations=jQuery.parseJSON(jQuery('form.variations_form').attr('data-product_variations')); for($i=0;$productVariations.length-1;$i++){if($productVariations[$i]['attributes'][$name]===$variation){$image=$productVariations[$i]['image']['src'];break;}} jQuery('.woocommerce-product-gallery__wrapper a').attr('href',$image); jQuery('.woocommerce-product-gallery__wrapper>a img').attr('src',$image); jQuery('.woocommerce-product-gallery__wrapper>a img').attr('srcset',''); } }); }); <?php } add_action('wp_footer', 'av_variation_product_image');Best regards,
YigitJune 1, 2017 at 5:08 pm #802661Thank you for reply,
I tried to enter the code in functions.php , but it does not work.June 5, 2017 at 9:55 pm #804184Hi,
We have also send the issue to our developers so they can take a look and identify the issue
It is working with other templates I can confirm, so it is something from our side.Best regards,
Basilis -
This topic was modified 8 years, 5 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
