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.