get(): ProductBasket[]¶
The get
method allows to retrieve a list of items inside the basket.
Returned value¶
A returned value has a type of ProductBasket[] representing a list of products inside the basket.
Example¶
In this example we make a basketProductsApi
call to retrieve a list of items inside the basket.
useStorefront(async ({ eventBus, getApi }) => {
eventBus.on('basket.initialized', async () => {
const basketProductsApi = await getApi('basketProductsApi');
const productsInBasket = basketProductsApi.get();
});
});
Basket Products API methods reference¶
- select$
- remove
- update
- getBasketCount
- selectBasketCount$
- getBasketPositions
- selectBasketPositions$
- getSum
- selectSum$
- getDiscountedSum
- selectDiscountedSum$
- getSectionValidation
- selectSectionValidation$