Events

Events

The following are the most recently added events, including any previous events.

getDeliveryLocations
noShippingDates
checkoutDisabled
eligibilityError
locationSelected
missingNote
enableCheckout
disableCheckout
missingNote

The following events are available in v7.0.5 and above.

widget_loaded
selected_method
delivery.datepicker.rendered 
delivery.datepicker.opened 
delivery.timepicker.rendered 
delivery.timepicker.opened 
pickup.datepicker.rendered 
pickup.datepicker.opened 
pickup.timepicker.rendered 
pickup.timepicker.opened
shipping.datepicker.rendered
shipping.datepicker.opened
checkoutEnabled

Example

You can access the above events using the following code:

$(document).ready(function() {
  window.ZapietEvent.listen('selected_method', function(checkout_method) {    
    switch (checkout_method) {
      case "pickup":
        // Do something when pickup is selected
        break;
      case "delivery":
        // Do something when delivery is selected
        break;
      case "shipping":
        // Do something when shipping is selected
        break;
    }
  });
});

If you use the example above, please ensure that jQuery is included in your theme.

Last updated