From 14fe1f1f69bfa3c430bcb33ee9642e39c0523e64 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Mon, 31 Jul 2023 17:30:58 +0300 Subject: [PATCH] docs: fixes to implement cart docs (#4645) --- .../storefront/implement-cart.mdx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/content/modules/carts-and-checkout/storefront/implement-cart.mdx b/docs/content/modules/carts-and-checkout/storefront/implement-cart.mdx index 05831e58f5..5e3e386a20 100644 --- a/docs/content/modules/carts-and-checkout/storefront/implement-cart.mdx +++ b/docs/content/modules/carts-and-checkout/storefront/implement-cart.mdx @@ -214,12 +214,16 @@ if (id) { ```tsx -import { useGetCart } from "medusa-react" +import { useCart } from "medusa-react" const Cart = () => { - const { cart, isLoading } = useGetCart(cart_id) - - // ... + const { cart } = useCart() + + return ( +
+ Items in Cart: {cart?.items.length || 0} +
+ ) } export default Cart @@ -647,4 +651,4 @@ It returns the updated cart. ## See Also -- [Implement the checkout flow in your storefront](./implement-checkout-flow.mdx) \ No newline at end of file +- [Implement the checkout flow in your storefront](./implement-checkout-flow.mdx)