Documentation

Everything you need to get started with Blocksy Theme and Companion

Auto-close Quick View after add to cart action

Snippet in action

This little snippet will help you automatically close the Quick View modal after adding the product to the cart. It is perfect for webmasters who want to streamline their customers’ shopping experience. It can be easily integrated with any plugin that adds JavaScript onto your website, or by using our Premium Custom Code Snippets extension.

<script> 
    jQuery(document.body).on('added_to_cart', function() { 
        let maybeCloseButton = document.querySelector('.ct-toggle-close') 
        if (! maybeCloseButton) return 
        maybeCloseButton.click() 
    })
</script>
Not the solution you are looking for?

Please check other articles or open a support ticket.