@sazito/checkout 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -335,8 +335,27 @@ interface RenderButtonProps {
335
335
  /** Localised label for the current step. */
336
336
  children: ReactNode;
337
337
  }
338
- interface RenderEmptyCartProps$1 {
338
+ interface RenderEmptyCartProps {
339
339
  continueShoppingUrl?: string;
340
+ title: ReactNode;
341
+ description: ReactNode;
342
+ actionLabel: ReactNode;
343
+ icon: ReactNode;
344
+ }
345
+ /** Content-level customisation for the built-in empty-cart screen. */
346
+ interface EmptyCartOptions {
347
+ /** Empty-state heading. Defaults to the active locale. */
348
+ title?: ReactNode;
349
+ /** Supporting copy below the heading. Defaults to the active locale. */
350
+ description?: ReactNode;
351
+ /** Label for the back-to-store action. Defaults to the active locale. */
352
+ actionLabel?: ReactNode;
353
+ /** Replace the built-in cart illustration. */
354
+ icon?: ReactNode;
355
+ /** Override config.continueShoppingUrl for this action only. */
356
+ actionUrl?: string;
357
+ /** Hide the action even when a continue-shopping URL is configured. */
358
+ hideAction?: boolean;
340
359
  }
341
360
  interface SazitoCheckoutProps {
342
361
  theme?: CheckoutTheme;
@@ -344,9 +363,10 @@ interface SazitoCheckoutProps {
344
363
  className?: string;
345
364
  renderNextButton?: (props: RenderButtonProps) => ReactNode;
346
365
  renderBackButton?: (props: RenderButtonProps) => ReactNode;
347
- renderEmptyCart?: (props: RenderEmptyCartProps$1) => ReactNode;
366
+ renderEmptyCart?: (props: RenderEmptyCartProps) => ReactNode;
367
+ emptyCart?: EmptyCartOptions;
348
368
  }
349
- declare function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButton, renderBackButton, renderEmptyCart, }: SazitoCheckoutProps): react_jsx_runtime.JSX.Element;
369
+ declare function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButton, renderBackButton, renderEmptyCart, emptyCart, }: SazitoCheckoutProps): react_jsx_runtime.JSX.Element;
350
370
 
351
371
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
352
372
  variant?: 'primary' | 'outline' | 'ghost';
@@ -388,9 +408,6 @@ interface ErrorBannerProps {
388
408
  }
389
409
  declare function ErrorBanner({ message, asChild, children, className }: ErrorBannerProps): react_jsx_runtime.JSX.Element;
390
410
 
391
- interface RenderEmptyCartProps {
392
- continueShoppingUrl?: string;
393
- }
394
411
  interface SazitoCheckoutPageProps {
395
412
  credentials?: CheckoutCredentials;
396
413
  config?: CheckoutConfig;
@@ -399,8 +416,9 @@ interface SazitoCheckoutPageProps {
399
416
  renderNextButton?: (props: RenderButtonProps) => React.ReactNode;
400
417
  renderBackButton?: (props: RenderButtonProps) => React.ReactNode;
401
418
  renderEmptyCart?: (props: RenderEmptyCartProps) => React.ReactNode;
419
+ emptyCart?: EmptyCartOptions;
402
420
  }
403
- declare function SazitoCheckoutPage({ credentials, config, paymentReturnParams, className, renderNextButton, renderBackButton, renderEmptyCart, }: SazitoCheckoutPageProps): react_jsx_runtime.JSX.Element;
421
+ declare function SazitoCheckoutPage({ credentials, config, paymentReturnParams, className, renderNextButton, renderBackButton, renderEmptyCart, emptyCart, }: SazitoCheckoutPageProps): react_jsx_runtime.JSX.Element;
404
422
 
405
423
  interface CheckoutProviderProps {
406
424
  /** Override the SazitoProvider client for this checkout instance only. */
@@ -433,4 +451,4 @@ interface SazitoProviderProps {
433
451
  declare function SazitoProvider({ client, children }: SazitoProviderProps): react_jsx_runtime.JSX.Element;
434
452
 
435
453
  export { Button, CheckoutProvider, ErrorBanner, Field, ProductPlaceholder, SazitoCheckout, SazitoCheckoutPage, SazitoProvider, SectionTitle, Spinner, useCheckout };
436
- export type { ButtonProps, CheckoutProviderProps, ErrorBannerProps, FieldProps, ProductPlaceholderProps, RenderButtonProps, RenderEmptyCartProps as RenderEmptyCartPageProps, RenderEmptyCartProps$1 as RenderEmptyCartProps, SazitoCheckoutPageProps, SazitoCheckoutProps, SazitoProviderProps, SectionTitleProps, SpinnerProps };
454
+ export type { ButtonProps, CheckoutProviderProps, EmptyCartOptions, ErrorBannerProps, FieldProps, ProductPlaceholderProps, RenderButtonProps, RenderEmptyCartProps as RenderEmptyCartPageProps, RenderEmptyCartProps, SazitoCheckoutPageProps, SazitoCheckoutProps, SazitoProviderProps, SectionTitleProps, SpinnerProps };
@@ -335,8 +335,27 @@ interface RenderButtonProps {
335
335
  /** Localised label for the current step. */
336
336
  children: ReactNode;
337
337
  }
338
- interface RenderEmptyCartProps$1 {
338
+ interface RenderEmptyCartProps {
339
339
  continueShoppingUrl?: string;
340
+ title: ReactNode;
341
+ description: ReactNode;
342
+ actionLabel: ReactNode;
343
+ icon: ReactNode;
344
+ }
345
+ /** Content-level customisation for the built-in empty-cart screen. */
346
+ interface EmptyCartOptions {
347
+ /** Empty-state heading. Defaults to the active locale. */
348
+ title?: ReactNode;
349
+ /** Supporting copy below the heading. Defaults to the active locale. */
350
+ description?: ReactNode;
351
+ /** Label for the back-to-store action. Defaults to the active locale. */
352
+ actionLabel?: ReactNode;
353
+ /** Replace the built-in cart illustration. */
354
+ icon?: ReactNode;
355
+ /** Override config.continueShoppingUrl for this action only. */
356
+ actionUrl?: string;
357
+ /** Hide the action even when a continue-shopping URL is configured. */
358
+ hideAction?: boolean;
340
359
  }
341
360
  interface SazitoCheckoutProps {
342
361
  theme?: CheckoutTheme;
@@ -344,9 +363,10 @@ interface SazitoCheckoutProps {
344
363
  className?: string;
345
364
  renderNextButton?: (props: RenderButtonProps) => ReactNode;
346
365
  renderBackButton?: (props: RenderButtonProps) => ReactNode;
347
- renderEmptyCart?: (props: RenderEmptyCartProps$1) => ReactNode;
366
+ renderEmptyCart?: (props: RenderEmptyCartProps) => ReactNode;
367
+ emptyCart?: EmptyCartOptions;
348
368
  }
349
- declare function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButton, renderBackButton, renderEmptyCart, }: SazitoCheckoutProps): react_jsx_runtime.JSX.Element;
369
+ declare function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButton, renderBackButton, renderEmptyCart, emptyCart, }: SazitoCheckoutProps): react_jsx_runtime.JSX.Element;
350
370
 
351
371
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
352
372
  variant?: 'primary' | 'outline' | 'ghost';
@@ -388,9 +408,6 @@ interface ErrorBannerProps {
388
408
  }
389
409
  declare function ErrorBanner({ message, asChild, children, className }: ErrorBannerProps): react_jsx_runtime.JSX.Element;
390
410
 
391
- interface RenderEmptyCartProps {
392
- continueShoppingUrl?: string;
393
- }
394
411
  interface SazitoCheckoutPageProps {
395
412
  credentials?: CheckoutCredentials;
396
413
  config?: CheckoutConfig;
@@ -399,8 +416,9 @@ interface SazitoCheckoutPageProps {
399
416
  renderNextButton?: (props: RenderButtonProps) => React.ReactNode;
400
417
  renderBackButton?: (props: RenderButtonProps) => React.ReactNode;
401
418
  renderEmptyCart?: (props: RenderEmptyCartProps) => React.ReactNode;
419
+ emptyCart?: EmptyCartOptions;
402
420
  }
403
- declare function SazitoCheckoutPage({ credentials, config, paymentReturnParams, className, renderNextButton, renderBackButton, renderEmptyCart, }: SazitoCheckoutPageProps): react_jsx_runtime.JSX.Element;
421
+ declare function SazitoCheckoutPage({ credentials, config, paymentReturnParams, className, renderNextButton, renderBackButton, renderEmptyCart, emptyCart, }: SazitoCheckoutPageProps): react_jsx_runtime.JSX.Element;
404
422
 
405
423
  interface CheckoutProviderProps {
406
424
  /** Override the SazitoProvider client for this checkout instance only. */
@@ -433,4 +451,4 @@ interface SazitoProviderProps {
433
451
  declare function SazitoProvider({ client, children }: SazitoProviderProps): react_jsx_runtime.JSX.Element;
434
452
 
435
453
  export { Button, CheckoutProvider, ErrorBanner, Field, ProductPlaceholder, SazitoCheckout, SazitoCheckoutPage, SazitoProvider, SectionTitle, Spinner, useCheckout };
436
- export type { ButtonProps, CheckoutProviderProps, ErrorBannerProps, FieldProps, ProductPlaceholderProps, RenderButtonProps, RenderEmptyCartProps as RenderEmptyCartPageProps, RenderEmptyCartProps$1 as RenderEmptyCartProps, SazitoCheckoutPageProps, SazitoCheckoutProps, SazitoProviderProps, SectionTitleProps, SpinnerProps };
454
+ export type { ButtonProps, CheckoutProviderProps, EmptyCartOptions, ErrorBannerProps, FieldProps, ProductPlaceholderProps, RenderButtonProps, RenderEmptyCartProps as RenderEmptyCartPageProps, RenderEmptyCartProps, SazitoCheckoutPageProps, SazitoCheckoutProps, SazitoProviderProps, SectionTitleProps, SpinnerProps };
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
3
  import { isValidElement, cloneElement, useMemo, useState, useRef, useEffect, useCallback } from 'react';
4
- import { u as useCheckout, b as useSazitoClient, C as CheckoutProvider } from '../chunks/use-checkout-gAjnCzae.js';
5
- export { S as SazitoProvider } from '../chunks/use-checkout-gAjnCzae.js';
6
- import { m as formatPercent, E as sortCartItemsNewestFirst, H as toPersianDigits, r as isDigitalServiceGroup, t as isValidIranianMobile, z as normalizeIranianPhone, A as paymentMethodInfo, l as formatNumber } from '../chunks/labels-ByA_yGKl.js';
4
+ import { u as useCheckout, b as useSazitoClient, C as CheckoutProvider } from '../chunks/use-checkout-Bh4tXxFJ.js';
5
+ export { S as SazitoProvider } from '../chunks/use-checkout-Bh4tXxFJ.js';
6
+ import { m as formatPercent, E as sortCartItemsNewestFirst, H as toPersianDigits, r as isDigitalServiceGroup, t as isValidIranianMobile, z as normalizeIranianPhone, A as paymentMethodInfo, l as formatNumber } from '../chunks/labels-BdxqgReM.js';
7
7
  import '@sazito/client-sdk';
8
8
 
9
9
  /**
@@ -185,17 +185,29 @@ function attrHexColor(value) {
185
185
  }
186
186
  return toHexColor(value);
187
187
  }
188
- function CartStep({ continueShoppingUrl, renderEmpty, }) {
188
+ function CartStep({ continueShoppingUrl, emptyCart, renderEmpty, }) {
189
189
  const { state, actions, money, t } = useCheckout();
190
190
  const cart = state.cart;
191
191
  const busy = state.flags.updatingCart;
192
192
  const newestCartItems = useMemo(() => sortCartItemsNewestFirst(cart?.items ?? []), [cart?.items]);
193
193
  const invoiceItemsByVariant = new Map((state.invoice?.items ?? []).map((item) => [item.productVariantId, item]));
194
194
  if (!cart || cart.items.length === 0) {
195
+ const title = emptyCart?.title ?? t.cartEmpty;
196
+ const description = emptyCart?.description ?? t.cartEmptyHint;
197
+ const actionLabel = emptyCart?.actionLabel ?? t.continueShopping;
198
+ const actionUrl = emptyCart?.actionUrl ?? continueShoppingUrl;
199
+ const visibleActionUrl = emptyCart?.hideAction ? undefined : actionUrl;
200
+ const icon = emptyCart?.icon ?? jsx(CartIcon, {});
195
201
  if (renderEmpty) {
196
- return renderEmpty({ continueShoppingUrl });
202
+ return renderEmpty({
203
+ continueShoppingUrl: visibleActionUrl,
204
+ title,
205
+ description,
206
+ actionLabel,
207
+ icon,
208
+ });
197
209
  }
198
- return (jsx("section", { className: "szc-empty", role: "status", "aria-live": "polite", children: jsxs("div", { className: "szc-empty__card", children: [jsx("span", { className: "szc-empty__badge", children: jsx(CartIcon, {}) }), jsxs("div", { className: "szc-empty__copy", children: [jsx("h3", { className: "szc-empty__title", children: t.cartEmpty }), jsx("p", { className: "szc-empty__hint", children: t.cartEmptyHint })] }), continueShoppingUrl ? (jsx(Button, { className: "szc-empty__cta", variant: "primary", onClick: () => { window.location.href = continueShoppingUrl; }, children: t.continueShopping })) : null] }) }));
210
+ return (jsx("section", { className: "szc-empty", role: "status", "aria-live": "polite", children: jsxs("div", { className: "szc-empty__card", children: [jsx("span", { className: "szc-empty__badge", "aria-hidden": "true", children: icon }), jsxs("div", { className: "szc-empty__copy", children: [jsx("h2", { className: "szc-empty__title", children: title }), jsx("p", { className: "szc-empty__hint", children: description })] }), visibleActionUrl ? (jsx(Button, { className: "szc-empty__cta", variant: "primary", asChild: true, children: jsx("a", { href: visibleActionUrl, children: actionLabel }) })) : null] }) }));
199
211
  }
200
212
  return (jsx("section", { className: "szc-step-panel", children: jsx("ul", { className: "szc-cart-list", children: newestCartItems.map((item) => {
201
213
  const max = item.product.maxOrderQuantity;
@@ -755,15 +767,16 @@ function themeVars(theme) {
755
767
  vars['--szc-font'] = theme.fontFamily;
756
768
  return vars;
757
769
  }
758
- function CheckoutSkeleton({ label }) {
759
- return (jsxs("div", { className: "szc-layout szc-skeleton-layout", role: "status", "aria-label": label, children: [jsxs("main", { className: "szc-main", "aria-hidden": "true", children: [jsxs("div", { className: "szc-skeleton-cart-row", children: [jsx("span", { className: "szc-skeleton szc-skeleton--thumb" }), jsxs("div", { className: "szc-skeleton-copy", children: [jsx("span", { className: "szc-skeleton szc-skeleton--title" }), jsx("span", { className: "szc-skeleton szc-skeleton--text" }), jsx("span", { className: "szc-skeleton szc-skeleton--price" })] }), jsx("span", { className: "szc-skeleton szc-skeleton--counter" })] }), jsxs("div", { className: "szc-skeleton-cart-row", children: [jsx("span", { className: "szc-skeleton szc-skeleton--thumb" }), jsxs("div", { className: "szc-skeleton-copy", children: [jsx("span", { className: "szc-skeleton szc-skeleton--title" }), jsx("span", { className: "szc-skeleton szc-skeleton--text" }), jsx("span", { className: "szc-skeleton szc-skeleton--price" })] }), jsx("span", { className: "szc-skeleton szc-skeleton--counter" })] })] }), jsxs("div", { className: "szc-side", "aria-hidden": "true", children: [jsxs("aside", { className: "szc-summary szc-summary--skeleton", children: [jsxs("div", { className: "szc-summary__total-head", children: [jsx("span", { className: "szc-skeleton szc-skeleton--summary-label" }), jsx("span", { className: "szc-skeleton szc-skeleton--summary-total" })] }), jsxs("div", { className: "szc-skeleton-summary-lines", children: [jsxs("div", { children: [jsx("span", { className: "szc-skeleton" }), jsx("span", { className: "szc-skeleton" })] }), jsxs("div", { children: [jsx("span", { className: "szc-skeleton" }), jsx("span", { className: "szc-skeleton" })] })] }), jsxs("div", { className: "szc-skeleton-summary-grand", children: [jsx("span", { className: "szc-skeleton" }), jsx("span", { className: "szc-skeleton" })] })] }), jsx("div", { className: "szc-side__cta", children: jsx("span", { className: "szc-skeleton szc-skeleton--button" }) })] })] }));
770
+ function CheckoutLoading({ label }) {
771
+ return (jsxs("div", { className: "szc-checkout-loading", role: "status", "aria-live": "polite", children: [jsx(Spinner, { className: "szc-checkout-loading__spinner" }), jsx("span", { children: label })] }));
760
772
  }
761
- function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButton, renderBackButton, renderEmptyCart, }) {
773
+ function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButton, renderBackButton, renderEmptyCart, emptyCart, }) {
762
774
  const { state, actions, t, summary, money } = useCheckout();
763
775
  const { step, direction, flags, error } = state;
764
776
  const isResult = step === 'result';
765
777
  const bootstrapping = step === 'cart' && !error && (!state.cart || !state.invoice || flags.bootstrapping);
766
- const fatal = error && !state.cart && step === 'cart';
778
+ const emptyCartError = error?.code === 'no_cart';
779
+ const fatal = error && !state.cart && step === 'cart' && !emptyCartError;
767
780
  const cartEmpty = !state.cart || state.cart.items.length === 0;
768
781
  const footerVisible = (step === 'cart' && !cartEmpty) || step === 'shipping' || step === 'payment';
769
782
  const nextBusy = state.status === 'working' ||
@@ -831,13 +844,13 @@ function SazitoCheckout({ theme, continueShoppingUrl, className, renderNextButto
831
844
  ? CardIcon
832
845
  : ClipboardIcon;
833
846
  const mobileHead = (jsxs("div", { className: "szc-mobile-head", children: [footerVisible && backVisible ? (jsx("button", { type: "button", className: "szc-mobile-head__back", "aria-label": t.back, onClick: backOnClick, children: jsx("svg", { className: "szc-back-arrow", viewBox: "0 0 16 16", width: "18", height: "18", fill: "none", "aria-hidden": "true", children: jsx("path", { d: "M9.5 3.5 5 8l4.5 4.5", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) })) : (jsx("span", {})), jsxs("span", { className: "szc-mobile-head__title", children: [jsx("span", { className: "szc-mobile-head__dot", children: jsx(HeadIcon, {}) }), headTitle] }), flowIndex >= 0 ? (jsx("span", { className: "szc-mobile-head__count", children: t.stepOf(formatNumber(flowIndex + 1, state.locale), formatNumber(flowSteps.length, state.locale)) })) : (jsx("span", {}))] }));
834
- return (jsxs("div", { className: `szc-root${className ? ` ${className}` : ''}`, dir: direction, style: themeVars(theme), children: [mobileHead, jsx(Stepper, {}), bootstrapping ? (jsx(CheckoutSkeleton, { label: t.loading })) : fatal ? (jsx(ErrorBanner, { message: error.message })) : isResult ? (jsx("div", { className: "szc-result-wrap", children: jsx(ResultStep, { continueShoppingUrl: continueShoppingUrl }) })) : (jsx(Fragment, { children: jsxs("div", { className: `szc-layout${cartEmpty ? ' szc-layout--full' : ''}`, children: [jsxs("main", { className: "szc-main", children: [error ? jsx(ErrorBanner, { message: error.message }) : null, step === 'cart' ? jsx(CartStep, { continueShoppingUrl: continueShoppingUrl, renderEmpty: renderEmptyCart }) : null, step === 'shipping' ? jsx(ShippingStep, {}) : null, step === 'payment' ? jsx(PaymentStep, {}) : null, actionsVisible && backButtonNode ? (jsx("div", { className: "szc-back-row", children: backButtonNode })) : null] }), !cartEmpty ? (jsxs("div", { className: "szc-side", children: [jsx(OrderSummary, {}), actionsVisible ? jsx("div", { className: "szc-side__cta", children: nextButtonNode }) : null] })) : null] }) })), actionsVisible ? (jsx("div", { className: "szc-footer-bar", children: jsxs("div", { className: "szc-footer", children: [jsxs("div", { className: "szc-footer__total", children: [jsx("span", { className: "szc-footer__total-label", children: t.total }), jsx("span", { className: "szc-footer__total-value", children: money(summary.total) })] }), jsx("div", { className: "szc-footer__actions", children: nextButtonNode })] }) })) : null] }));
847
+ return (jsxs("div", { className: `szc-root${className ? ` ${className}` : ''}`, dir: direction, style: themeVars(theme), children: [mobileHead, jsx(Stepper, {}), bootstrapping ? (jsx(CheckoutLoading, { label: t.loading })) : fatal ? (jsx(ErrorBanner, { message: error.message })) : isResult ? (jsx("div", { className: "szc-result-wrap", children: jsx(ResultStep, { continueShoppingUrl: continueShoppingUrl }) })) : (jsx(Fragment, { children: jsxs("div", { className: `szc-layout${cartEmpty ? ' szc-layout--full' : ''}`, children: [jsxs("main", { className: "szc-main", children: [error && !emptyCartError ? jsx(ErrorBanner, { message: error.message }) : null, step === 'cart' ? (jsx(CartStep, { continueShoppingUrl: continueShoppingUrl, emptyCart: emptyCart, renderEmpty: renderEmptyCart })) : null, step === 'shipping' ? jsx(ShippingStep, {}) : null, step === 'payment' ? jsx(PaymentStep, {}) : null, actionsVisible && backButtonNode ? (jsx("div", { className: "szc-back-row", children: backButtonNode })) : null] }), !cartEmpty ? (jsxs("div", { className: "szc-side", children: [jsx(OrderSummary, {}), actionsVisible ? jsx("div", { className: "szc-side__cta", children: nextButtonNode }) : null] })) : null] }) })), actionsVisible ? (jsx("div", { className: "szc-footer-bar", children: jsxs("div", { className: "szc-footer", children: [jsxs("div", { className: "szc-footer__total", children: [jsx("span", { className: "szc-footer__total-label", children: t.total }), jsx("span", { className: "szc-footer__total-value", children: money(summary.total) })] }), jsx("div", { className: "szc-footer__actions", children: nextButtonNode })] }) })) : null] }));
835
848
  }
836
849
 
837
- function SazitoCheckoutPage({ credentials, config, paymentReturnParams, className, renderNextButton, renderBackButton, renderEmptyCart, }) {
850
+ function SazitoCheckoutPage({ credentials, config, paymentReturnParams, className, renderNextButton, renderBackButton, renderEmptyCart, emptyCart, }) {
838
851
  const isReturn = paymentReturnParams != null;
839
852
  const client = useSazitoClient();
840
- return (jsxs(CheckoutProvider, { client: client, credentials: credentials, config: config, autoStart: !isReturn, children: [isReturn ? jsx(ResolveReturn, { params: paymentReturnParams }) : null, jsx(SazitoCheckout, { theme: config?.theme, continueShoppingUrl: config?.continueShoppingUrl, className: className, renderNextButton: renderNextButton, renderBackButton: renderBackButton, renderEmptyCart: renderEmptyCart })] }));
853
+ return (jsxs(CheckoutProvider, { client: client, credentials: credentials, config: config, autoStart: !isReturn, children: [isReturn ? jsx(ResolveReturn, { params: paymentReturnParams }) : null, jsx(SazitoCheckout, { theme: config?.theme, continueShoppingUrl: config?.continueShoppingUrl, className: className, renderNextButton: renderNextButton, renderBackButton: renderBackButton, renderEmptyCart: renderEmptyCart, emptyCart: emptyCart })] }));
841
854
  }
842
855
  function ResolveReturn({ params }) {
843
856
  const { actions } = useCheckout();