Skip to main content

Bar

These methods allow you to interact with the Bar.

note

Please keep in mind that the CartPops API is subject to change. Before updating, please check the changelog to learn what has changed and whether you can safely upgrade.

.on('show', ...)

This event fires after the clicking the add to cart button or when the Bar opens programmatically — for example with a Javascript method.

🛠 Arguments

ArgumentTypeDescription
barobjectHolds the bar with all options and properties.

🌈 Example

jQuery(function($) {
CartPops.bar.on( 'show', function( bar ) {
// Do something here 🦄
} );
});

.on('hide', ...)

This event fires after the user dismissed the Bar via a button, by clicking the Bar overlay, by pressing the escape key, or when the Bar closes progammaticaly — for example with a Javascript method.

🛠 Arguments

ArgumentTypeDescription
barobjectHolds the bar with all options and properties.

🌈 Example

jQuery(function($) {
CartPops.bar.on( 'hide', function( bar ) {
// Do something here 🦄
} );
});