isEveryAvailablePaymentFree(): boolean¶
The isEveryAvailablePaymentFree
method allows to check if every available payment option is free.
Returned value¶
A returned value has a type of boolean
. If every available payment option is free it's true
. Otherwise it's false
.
Example¶
In this example we make a basketShippingsApi
call to check if every available payment option is free.
useStorefront(async ({ eventBus, getApi }) => {
eventBus.on('basket.initialized', async () => {
const basketShippingsApi = await getApi('basketShippingsApi');
const isEveryAvailablePaymentFree = basketShippingsApi.isEveryAvailablePaymentFree();
if (isEveryAvailablePaymentFree) {
// do something
}
});
});
Basket Address API methods reference¶
- get
- select
- setShipping
- setPickupPoint
- getSelectedShipping
- selectSelectedShipping
- getAvailableShippingCountries
- selectAvailableShippingCountries
- getSelectedShippingCountry
- selectSelectedShippingCountry
- setCountry
- getPaymentCostForActiveShippingByPaymentId
- selectPaymentCostForActiveShippingByPaymentId
- selectIsEveryAvailablePaymentFree
- getSectionValidation
- selectSectionValidation
- addMap
- showPickupPointMap
- shouldDisplayRemainingBasketValueForFreeShippingMessage
- addShippingInfo
- getShippingInfo