docs: update storefront development guides to use JS SDK [2] (#12015)

This commit is contained in:
Shahed Nasser
2025-03-27 17:14:22 +02:00
committed by GitHub
parent 1895d8cc11
commit bf882b5aff
43 changed files with 13257 additions and 13309 deletions
@@ -77,6 +77,12 @@ The fields that are most commonly used are:
Here's an example of how you can show the cart totals in a React component:
<Note title="Tip">
This example uses the `useCart` hook from the [Cart Context](../context/page.mdx) to retrieve the cart.
</Note>
export const highlights = [
["3", "useCart", "The `useCart` hook was defined in the Cart React Context documentation."],
["8", "formatPrice", "A function to format a price using the `Intl.NumberFormat` API."],
@@ -90,7 +96,7 @@ export const highlights = [
```tsx highlights={highlights}
"use client" // include with Next.js 13+
import { useCart } from "../../../providers/cart"
import { useCart } from "@/providers/cart"
export default function CartTotals() {
const { cart } = useCart()