# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zapiet.com/javascript-api/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
