Shipping option changed callback
Optional callback that allows partner to get shipping option price and currency for currently selected shipping option in Ingrid form inside Checkout3.
Callback is triggered in multiple cases:
- Ingrid form is loaded inside Checkout3 form
- New shipping option is selected in Ingrid form by the user
Registering callback
To use this optional callback, partner has to pass an additional flag shippingOptionChangedCallback to avardaCheckoutInit. Please refer to Showing the checkout form for additional info about Checkout 3 Form initialisation.
Callback payload
Callback payload is an object with price, currency and taxAmount properties as the first parameter and checkoutInstance as the second parameter (not necessary to use it).
priceis the price of the selected shipping option (including tax), represented as a numbercurrencyis the currency code for the shipping option price (for example"SEK","EUR"), represented as a stringtaxAmountis the tax applied to the shipping price, represented as a number
The example below shows how to use these values in a callback function.