How to hide the Drawer after a certain time period

It’s possible to hide the Drawer or Popup after a certain time period by listening to the shown event. In this example below, we’ll automatically close the Drawer after 4 seconds after it has been opened.

jQuery(document).ready(function($){
	window.CartPops.drawer.on( 'show', function( ev ) {
		setTimeout(() => {
			window.CartPops.drawer.hide();
		}, 4000 );
	} );
});

It's time to improve your WooCommerce Cart

CartPops is a WooCommerce Add To Cart Popup, that helps every shop owner improve their user experience, increase conversions & maximize profits.

Was this page helpful?