Skip to main content
Version: Next

Events

We've included some events that you can listen to in order to and make something happens when these events are triggered.

Example#

document.addEventListener("PelcroElementsCartOpened", function(event) {
//Do something
});

List of events#

Event triggeredDescription
PelcroElementsCartOpenedThis occurs when the cart is opened using the switchView("cart"); function, and includes the cart items in the event detail.
PelcroElementsCartItemAddedThis occurs when adding a new item to your cart using the addToCart(123); function, and includes the added item in the event detail.
PelcroElementsCartItemRemovedThis occurs when removing an item from your cart using the removeFromCart(123); function, and includes the removed item in the event detail.