getSum(): Price[]¶
The getSum
method allows to get a list of tax prices associated with a current basket.
Returned value¶
A returned value has a type of Price[] representing a list of tax prices.
Example¶
In this example we make a basketTaxesApi
call to get the list of tax prices for a current basket.
useStorefront(async ({ eventBus, getApi }) => {
eventBus.on('basket.initialized', async () => {
const basketTaxesApi = await getApi('basketTaxesApi');
const taxPrices = basketTaxesApi.getSum();
});
});