docs: fixes to implement cart docs (#4645)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2023-07-31 17:30:58 +03:00
1 parent da903fd798
commit 14fe1f1f69
1 file changed
+9 -5
@@ -214,12 +214,16 @@ if (id) {
<TabItem value="medusa-react" label="Medusa React" default> <TabItem value="medusa-react" label="Medusa React" default>
```tsx ```tsx
import { useGetCart } from "medusa-react" import { useCart } from "medusa-react"
const Cart = () => { const Cart = () => {
const { cart, isLoading } = useGetCart(cart_id) const { cart } = useCart()
// ... return (
<div>
Items in Cart: {cart?.items.length || 0}
</div>
)
} }
export default Cart export default Cart
@@ -647,4 +651,4 @@ It returns the updated cart.
## See Also ## See Also
- [Implement the checkout flow in your storefront](./implement-checkout-flow.mdx) - [Implement the checkout flow in your storefront](./implement-checkout-flow.mdx)