Available events

The following events are currently 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

Listening for events

You can listen to the events by using the following code

<script type="text/javascript">
$(document).ready(function() {
window.ZapietEvent.listen('pickup.timepicker.opened', function() {
// Callback code
});
});
</script>

Checkout method update example

<script type="text/javascript">
$(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;
}
});
});
</script>

Hidden attributes

We add a number of hidden attributes to your orders. We have documented these below.

attributes.Checkout-Method (pickup, delivery or shipping) 
attributes.Pickup-Location-Id
attributes.Pickup-Location-Company
attributes.Pickup-Location-Address-Line-1
attributes.Pickup-Location-Address-Line-2
attributes.Pickup-Location-City
attributes.Pickup-Location-Region
attributes.Pickup-Location-Postal-Code
attributes.Pickup-Location-Country
attributes.Pickup-Date
attributes.Pickup-Time
attributes.Delivery-Location-Id
attributes.Delivery-Date
attributes.Delivery-Time
attributes.Delivery-Slot-Id (Internal use only)
attributes.Shipping-Date
Custom-Attribute-1
Custom-Attribute-2
Custom-Attribute-3
Did this answer your question?