Skip to content

Events

When using jQuery, you can bind custom actions to various events. For example, after adding an item to the cart you can update the order total on the page, etc.

Add to cart (order:itemadded)

javascript
$(document).on('order:itemadded', function(event, data) {
    // custom action
});

The event passes an object with the following content:

javascript
{
    item: {
        id: 1, // internal product id
        name: 'abc' // product name
    }
}

Successful newsletter subscription (newsletter:success)

javascript
$(document).on('newsletter:success', function(event, data) {
    // custom action
});

The event passes an object with the following content:

javascript
{
    email: 'info@example.org' // registered email
}

Failed newsletter subscription (newsletter:error)

javascript
$(document).on('newsletter:error', function(event, data) {
    // custom action
});

The event passes an object with the following content:

javascript
{
    email: 'info@example.org'
}

Page change (listing:changed)

Fires when the page changes during dynamic loading.

javascript
$('div.list').on('listing:changed', function(event, data) {
    // custom action
});

Dynamic content loaded (reload)

Fires after content is loaded via the reload() function.

javascript
$(document).on('reload', 'div.list', function(event) {
    // custom action
});

Lazy menu loaded

Fires after menu content is loaded in <i:menu-container>.

javascript
$(document).on('menu:loaded', function(event) {
    // custom action
});