getActions(): TBasketActions¶
The getActions
method allows to retrieve a key value object with various basket actions.
Returned value¶
A returned value has a type of TBasketActions representing an object with basket actions inside.
Example¶
In this example we make a basketOverallApi
call to get an action for changing a billing address in order to set its new value. We also use a getBillingAddress method from Basket Addresses API to get the action for setting the billing address with the retrieved action.
useStorefront(async (storefront) => {
const basketAddressesApi = storefront.getApiSync('basketAddressesApi');
const basketOverallApi = storefront.getApiSync('basketOverallApi');
const changeBillingAddressAction = basketOverallApi.getActions().changeBillingAddress;
await basketAddressesApi.setBillingAddress(changeBillingAddressAction, {
isCompany: false,
companyName: '',
firstName: 'John',
lastName: 'Snow',
personalIdNumber: '',
taxId: '',
countryId: 'US',
city: 'My City',
postalCode: '12-345',
street: 'example street 8',
street2: '',
phone: '123456789',
state: '',
useAsBillingAddress: false,
createUserAccount: false
});
});
Basket Overall API methods reference¶
- selectActions$
- getId
- selectId$
- getComment
- selectComment$
- getIsVatEu
- selectIsVatEu$
- getDelivery
- selectDelivery$
- getSum
- selectSum$
- getSumWithoutPaymentAndShipping
- selectSumWithoutPaymentAndShipping$
- cleanBasket
- setComment
- getInvalidSections
- selectInvalidSections$
- getSectionValidation
- selectSectionValidation$