> For the complete documentation index, see [llms.txt](https://docs.zapiet.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zapiet.com/javascript-api/events.md).

# Events

## Events

{% hint style="info" %}
The following are the most recently added events, including any previous events.
{% endhint %}

```
getDeliveryLocations
noShippingDates
checkoutDisabled
eligibilityError
locationSelected
missingNote
enableCheckout
disableCheckout
missingNote
```

{% hint style="info" %}
The following events are available in **v7.0.5** and above.&#x20;
{% endhint %}

```
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:

```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;
    }
  });
});
```

{% hint style="info" %}
If you use the example above, please ensure that [jQuery](https://code.jquery.com) is included in your theme.
{% endhint %}
