docs: add manage promotions in cart storefront guide (#13483)

* docs: add manage promotions in cart storefront guide

* fix incorrect cURL example
This commit is contained in:
Shahed Nasser
2025-09-15 12:29:55 +03:00
committed by GitHub
parent 23d5a902b1
commit 2657f9c196
15 changed files with 215 additions and 8 deletions
+5 -5
View File
@@ -74126,9 +74126,9 @@ const StripeSavedPaymentMethodsContainer = ({
SavedPaymentMethod[]
>([])
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState<
string | undefined
string | null
>(
paymentSession?.data?.payment_method_id as string | undefined
paymentSession?.data?.payment_method as string | null
)
useEffect(() => {
@@ -74274,7 +74274,7 @@ Then, add a new state variable that keeps track of whether the customer is using
```ts title="src/modules/checkout/components/payment-container/index.tsx" badgeLabel="Storefront" badgeColor="blue"
const [isUsingSavedPaymentMethod, setIsUsingSavedPaymentMethod] = useState(
paymentSession?.data?.payment_method_id !== undefined
paymentSession?.data?.payment_method !== null
)
```
@@ -74411,7 +74411,7 @@ So, you need to update the `confirmCardPayment` usage to support passing the ID
In `src/modules/checkout/components/payment-button/index.tsx`, find the `handlePayment` method and update its first `if` condition:
```ts title="src/modules/checkout/components/payment-button/index.tsx" badgeLabel="Storefront" badgeColor="blue"
if (!stripe || !elements || (!card && !session?.data.payment_method_id) || !cart) {
if (!stripe || !elements || (!card && !session?.data.payment_method) || !cart) {
setSubmitting(false)
return
}
@@ -74424,7 +74424,7 @@ Then, find the usage of `confirmCardPayment` in the `handlePayment` function and
```ts title="src/modules/checkout/components/payment-button/index.tsx" badgeLabel="Storefront" badgeColor="blue" highlights={confirmPaymentHighlights}
await stripe
.confirmCardPayment(session?.data.client_secret as string, {
payment_method: session?.data.payment_method_id as string || {
payment_method: session?.data.payment_method as string || {
card: card!,
billing_details: {
name: