• Resolved tajmohamed30

    (@tajmohamed30)


    Hi

    Please may I know how to close quickview on product added to cart in quickview.

    Tried below code but doesn’t work

    add_action( ‘wp_footer’, function(){
    ?>
    <script type=”text/javascript”>
    jQuery(document).ready(function($){
    $(‘.single_add_to_cart_button’).click(function(){
    $(‘.yith-wcqv-close’).trigger(‘click’);
    })
    })
    </script>
    <?php
    } );

    Regards

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter tajmohamed30

    (@tajmohamed30)

    fyi – website optimized to mobile view so please keep browser minimised to mobile screen, quick view button is mentioned as “+” icon

    Plugin Support Leanza Francesco

    (@leanzafrancesco)

    Hi,
    and thank you for writing in!

    To achieve your goal you should add the following code snippet to your theme functions.php:

    if ( !function_exists( 'yith_wcqv_customization_hide_quick_view_after_add_to_cart' ) ) {
    	add_action( 'wp_enqueue_scripts', 'yith_wcqv_customization_hide_quick_view_after_add_to_cart', 99 );
    	function yith_wcqv_customization_hide_quick_view_after_add_to_cart() {
    		$js = "jQuery( 'body' ).on( 'added_to_cart', function () {jQuery( '#yith-quick-view-close' ).trigger( 'click' );} );";
    		wp_add_inline_script( 'yith-wcqv-frontend', $js );
    	}
    }

    This should do the trick ??

    Please try this solution and let us know if everything works fine!

    Thread Starter tajmohamed30

    (@tajmohamed30)

    thank you very much, this is what im looking for

    it will be great to have this option in default quickview options

    Plugin Support Leanza Francesco

    (@leanzafrancesco)

    Hi,
    you are welcome!

    This feature (as many other ones) is already available in the premium version of the plugin.
    We provided the code snippet as an exception, since in this case, it was only few lines of code. However we’ll evaluate the possibility to add this option to this plugin version.

    Thread Starter tajmohamed30

    (@tajmohamed30)

    thank you very much ??

    Plugin Support Leanza Francesco

    (@leanzafrancesco)

    Hi,
    you are welcome! ??

    If you like the plugin and our support, please, support us with a good review. It takes just a minute. Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Close quickview on click add to cart’ is closed to new replies.