useCurrentCart
This hook returns the current Shopify cart object from the app's persisted storage. Use it to access cart data outside of the cart page.
Import
import { useCurrentCart } from '@appmaker-xyz/shopify';
Basic Usage
const cart = useCurrentCart();
Return Value
| Property | Type | Description |
|---|---|---|
cart | Object \| undefined | The current Shopify cart object stored in app storage. Returns undefined if no cart exists. |