docs: fixes to implement cart docs (#4645)

This commit is contained in:
Shahed Nasser
2023-07-31 17:30:58 +03:00
committed by GitHub
parent da903fd798
commit 14fe1f1f69

View File

@@ -214,12 +214,16 @@ if (id) {
<TabItem value="medusa-react" label="Medusa React" default>
```tsx
import { useGetCart } from "medusa-react"
import { useCart } from "medusa-react"
const Cart = () => {
const { cart, isLoading } = useGetCart(cart_id)
// ...
const { cart } = useCart()
return (
<div>
Items in Cart: {cart?.items.length || 0}
</div>
)
}
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)
- [Implement the checkout flow in your storefront](./implement-checkout-flow.mdx)