Skip to main content

How to get cart object outside the components

You can access the cart through the AppStorageState. This can be particularly helpful when you need to retrieve the cart object within a custom extension or in a filter that is not within the theme's components.

Usage

import { appStorageApi } from '@appmaker-xyz/core';
const checkout = appStorageApi()?.getState()?.checkout;