• Resolved jr75

    (@jr75)


    Hello,

    I wish to modify my archive single product page to change the variation image when only clicking on the color (i have color + size).
    I have creating the JS event for each color btn but i cannot figure how to access the JS librairy of “Additional Variation Images Gallery for WooCommercey” when on the single product page.
    I’ve looked at the source and it seems i need to call the method:
    key: ‘showVariationImage’,
    value: function showVariationImage(variation)

    I’ve tried to access this: jQuery(‘.woo-variation-gallery-wrapper’) but i cannot figure how to use it !

    I you can help me.
    Best regards,
    Jérémy

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support fizanzvai

    (@fizanzvai)

    @jr75

    Thanks for reaching out to us. This is not the purpose of our plugin. Our plugin will work on a single product/ product description page.

    To change the image on the archive page, for each variation you can try our Variation Swatches plugin.

    Thanks

    Thread Starter jr75

    (@jr75)

    Hello,

    We already have the Variation Swatches plugin but it slows to much the product listing:
    if i activate it, the product listing on the website take roughtly +10-15sec of loading.
    That’s why we decided to work without it (too bad, he had all the functionnalities needed – i can provide you the license key if needed)

    So I recoded most of the function and its working. Except for changing the additionnal images of each variation which are using the method of yor plugin.

    Plugin Support fizanzvai

    (@fizanzvai)

    @jr75

    What is the current version of the variation gallery plugin you are using?

    Thank You

    Thread Starter jr75

    (@jr75)

    Hello,

    i Had the last one, but don’t worry i found how to do it in JS. Thx !

    Plugin Support fizanzvai

    (@fizanzvai)

    Hi @jr75 ,

    We are working on Swatches Version 2. To make it more optimized. Hopefully, you will get it for the production site soon. Right now it is under construction.

    Please try the below snippet inside your child theme’s functions.php.

    function add_variaiton_js(){
    ?>
    <script>
    jQuery( document ).ready( function($){
    $( “.single_variation_wrap” ).on( “show_variation”, function ( event, variation ) {
    console.log( variation );
    } );
    } );
    </script>
    <?php
    }

    add_action( ‘wp_footer’, ‘add_variaiton_js’, 99 );

    Then you can get images of each variation on the browser console.

    Hopefully, it will help.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Calling js function to showVariationImage’ is closed to new replies.