@ecomiq/storefront 3.0.1 → 3.1.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.
- package/README.md +21 -0
- package/dist/{account-Dx4e3syi.js → account-CZZ-ku6L.js} +4 -4
- package/dist/account.d.ts +9 -0
- package/dist/analytics/{analytics-CG1Qagwl.js → analytics-CiG_O37p.js} +4 -4
- package/dist/analytics/{config-DJr-GRhs.js → config-DN5B1GOG.js} +3 -3
- package/dist/analytics/{consent-B13rBpBs.js → consent-D0-iQ4bg.js} +1 -1
- package/dist/analytics/{consent-banner-9QvRRy8v.js → consent-banner-D36fpU89.js} +1 -1
- package/dist/analytics/{cookies-pLozllyB.js → cookies-CWsi-zSd.js} +1 -1
- package/dist/analytics/{events-Dt81tIp1.js → events-CWmKY7oX.js} +2 -1
- package/dist/analytics/{tracker-p4yaoOyk.js → tracker-DpfDB2sY.js} +1 -1
- package/dist/{bank-accounts-DlEczQQ5.js → bank-accounts-MpKIxHaX.js} +1 -1
- package/dist/{captcha-DAqaIx8m.js → captcha-CZkpghTO.js} +1 -1
- package/dist/{cart-actions-Bsub_FFG.js → cart-actions-IKRYGqfj.js} +32 -9
- package/dist/{cart-form-y9P1r_EX.js → cart-form-Bq_B-Rh6.js} +6 -4
- package/dist/cart-form.d.ts +2 -1
- package/dist/{cart-summary-ur2VWKr-.js → cart-summary-B6vtRGBO.js} +6 -1
- package/dist/cart-summary.d.ts +2 -1
- package/dist/{catalog-hooks-B7ZP4wYY.js → catalog-hooks-DjmpXROv.js} +1 -1
- package/dist/{checkout-DVWSXANi.js → checkout-DsI1MY14.js} +6 -6
- package/dist/{complaint-book-BvwLvfx0.js → complaint-book-aAQfGBvo.js} +2 -2
- package/dist/{culqi-authentication-BGr20vAJ.js → culqi-authentication-DHxjPJRE.js} +1 -1
- package/dist/{customer-document-fields-C1K-_DAD.js → customer-document-fields-BzLdztjM.js} +1 -1
- package/dist/{customer-login-form-C7AC6vXd.js → customer-login-form-k_q7_7FX.js} +2 -2
- package/dist/{customer-registration-form-BEm_NEfP.js → customer-registration-form-PrBqUuI9.js} +1 -1
- package/dist/entries/account.js +5 -5
- package/dist/entries/analytics.js +4 -4
- package/dist/entries/cart.d.ts +2 -1
- package/dist/entries/cart.js +6 -5
- package/dist/entries/checkout.js +8 -8
- package/dist/entries/order.js +8 -8
- package/dist/{form-contracts-BNpHaTGJ.js → form-contracts-0R112spH.js} +11 -4
- package/dist/form-contracts.d.ts +3 -3
- package/dist/index.js +29 -29
- package/dist/{invoice-fields-BG0HjL6T.js → invoice-fields-BzDfV1nR.js} +1 -1
- package/dist/{mercadopago-dialog-UTQev0MG.js → mercadopago-dialog-CpGlgKBl.js} +2 -2
- package/dist/{optimistic-cart-BveVOHuh.js → optimistic-cart-DcJ8-tCw.js} +1 -1
- package/dist/{order-display-DTt5WBbc.js → order-display-CUXVESaF.js} +19 -10
- package/dist/{order-draft-DxV1Uhm3.js → order-draft-D8sqUUNp.js} +1 -1
- package/dist/{order-payment-continuation-D_d5PGA4.js → order-payment-continuation-CS6omD7E.js} +3 -3
- package/dist/{order-payment-in-review-x4gdLFHZ.js → order-payment-in-review-D5Y8bjGA.js} +1 -1
- package/dist/{order-status-BJXLJwxq.js → order-status-QsmEO-89.js} +3 -3
- package/dist/{page-seo-a5FJl8x5.js → page-seo-BKG-Ta6t.js} +3 -3
- package/dist/{pages-Ca_Gt6mq.js → pages-DyItxkdE.js} +4 -4
- package/dist/{payment-dialog-frame-B-Q_xQ94.js → payment-dialog-frame-xtidt_eM.js} +1 -1
- package/dist/personalization-BSVlktZP.js +94 -0
- package/dist/personalization-fields-CwBR8oGr.js +363 -0
- package/dist/personalization-fields.d.ts +17 -0
- package/dist/{preview-BiIBif3C.js → preview-JWdMO6kX.js} +6 -4
- package/dist/{preview-address-Cf0sJ-9p.js → preview-address-bvieGEKb.js} +1 -1
- package/dist/{preview-cart-Dg2CVktS.js → preview-cart-COIP3Vfh.js} +3 -2
- package/dist/{public-pages-XtwlaLwt.js → public-pages-Byh01h-6.js} +2 -2
- package/dist/{registration-CpDcv8ql.js → registration-h_00PAhj.js} +3 -3
- package/dist/{route-text-DcJw2SsK.js → route-text-B6pWdevi.js} +1 -1
- package/dist/{section-preview-CmsMl3yu.js → section-preview-BiYfeE-d.js} +2 -2
- package/dist/sections/account-addresses.js +2 -2
- package/dist/sections/account-order.js +11 -6
- package/dist/sections/account-orders.js +3 -3
- package/dist/sections/account-profile.js +2 -2
- package/dist/sections/checkout.js +18 -11
- package/dist/sections/complaint-book.js +3 -3
- package/dist/sections/design-system.js +1 -1
- package/dist/sections/draft-invoice.js +7 -2
- package/dist/{sections-CNUMWTF_.js → sections-CgpjubkB.js} +1 -1
- package/dist/{seo-GpDRhAAA.js → seo-D9UdUMg9.js} +2 -2
- package/dist/{session-CKvmFJyg.js → session-DR_9-bcf.js} +30 -6
- package/dist/{store-8Q-_LFrQ.js → store-uU2gWdMY.js} +2 -2
- package/dist/{storefront-language-DrMjVbmk.js → storefront-language-Bnt-TU2F.js} +1 -1
- package/dist/{storefront-text-D25ae1qf.js → storefront-text-Co7iUnLM.js} +2 -2
- package/dist/{storefront-text-en-ljjjSS4q.js → storefront-text-en-DzYmdOuY.js} +6 -1
- package/dist/{storefront-text-pt-BtHaJLcp.js → storefront-text-pt-CizClH0I.js} +6 -1
- package/dist/{stripe-dialog-Ev9s3Z62.js → stripe-dialog-D88qfkUS.js} +2 -2
- package/dist/{templates-CAqoNyTW.js → templates-AgGupnPA.js} +2 -2
- package/dist/{urls-CpGQPxvf.js → urls-D4uinJVd.js} +1 -1
- package/dist/{use-checkout-CZcxXJXi.js → use-checkout-Jdk8P12A.js} +1 -1
- package/dist/{use-checkout-payment-9R-zacrJ.js → use-checkout-payment-BGX-BE6D.js} +1 -1
- package/dist/{voucher-payment-CVFDZ1L8.js → voucher-payment-B3o9ybg6.js} +1 -1
- package/dist/{worker-CNi-gzCu.js → worker-cbXmLvfR.js} +2 -2
- package/package.json +2 -2
- package/src/sections/account-order.tsx +4 -2
- package/src/sections/checkout.tsx +4 -1
- package/src/sections/draft-invoice.tsx +2 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { loadStorefrontTranslations, storefrontText } from "./storefront-text-
|
|
2
|
-
import { captchaResponse } from "./captcha-
|
|
1
|
+
import { loadStorefrontTranslations, storefrontText } from "./storefront-text-Co7iUnLM.js";
|
|
2
|
+
import { captchaResponse } from "./captcha-CZkpghTO.js";
|
|
3
3
|
import { base64Url, customerCookies, customerSessionId, equalSecret } from "./customer-cookies-DHOgFAMV.js";
|
|
4
4
|
import { safeNext } from "./form-BtQcbXlJ.js";
|
|
5
|
-
import { PREVIEW_TOKEN } from "./preview-
|
|
5
|
+
import { PREVIEW_TOKEN } from "./preview-JWdMO6kX.js";
|
|
6
6
|
import { customerClientHeaders, customerCsrfTokenForRequest, rejectCrossOriginAction } from "./request-security-CRsRMgwj.js";
|
|
7
|
-
import { store } from "./store-
|
|
8
|
-
import { requestUrl } from "./urls-
|
|
9
|
-
import { worker } from "./worker-
|
|
7
|
+
import { store } from "./store-uU2gWdMY.js";
|
|
8
|
+
import { requestUrl } from "./urls-D4uinJVd.js";
|
|
9
|
+
import { worker } from "./worker-cbXmLvfR.js";
|
|
10
10
|
import { data, redirect } from "react-router";
|
|
11
11
|
import { ApiError } from "@ecomiq/core";
|
|
12
12
|
import { z } from "zod";
|
|
@@ -38,6 +38,12 @@ const ChallengeErrorSchema = z.object({
|
|
|
38
38
|
message: z.string(),
|
|
39
39
|
needsSecondFactor: z.boolean().optional()
|
|
40
40
|
});
|
|
41
|
+
const EDITOR_CAPTCHA = {
|
|
42
|
+
provider: "off",
|
|
43
|
+
siteKey: null,
|
|
44
|
+
isConfigured: true
|
|
45
|
+
};
|
|
46
|
+
const EDITOR_LOGIN_NOTICE = "El ingreso de clientes solo funciona en la tienda publicada.";
|
|
41
47
|
function validLoginTransaction(transaction, configuration, origin) {
|
|
42
48
|
if (Date.now() - transaction.createdAt > 6e5 || transaction.createdAt > Date.now() || transaction.redirectUri !== new URL("/account/callback", origin).href || transaction.redirectUri !== configuration.redirectUri || transaction.authorizationEndpoint !== configuration.authorizationEndpoint || transaction.loginMode !== configuration.loginMode) return false;
|
|
43
49
|
const authorize = new URL(transaction.returnUrl, configuration.authority);
|
|
@@ -68,6 +74,15 @@ async function customerCsrfToken(request, context) {
|
|
|
68
74
|
function previewing(request, env) {
|
|
69
75
|
return env.ECOMIQ_PREVIEW === "1" && !/^\/account\/(login|callback)(\/|$)/.test(requestUrl(request).pathname);
|
|
70
76
|
}
|
|
77
|
+
function editorLoginForm(email, error) {
|
|
78
|
+
return data({
|
|
79
|
+
step: "email",
|
|
80
|
+
email,
|
|
81
|
+
captcha: EDITOR_CAPTCHA,
|
|
82
|
+
retryAt: 0,
|
|
83
|
+
error
|
|
84
|
+
}, { headers: PRIVATE_HEADERS });
|
|
85
|
+
}
|
|
71
86
|
async function readCustomer(request, context) {
|
|
72
87
|
const env = context.get(worker).env;
|
|
73
88
|
if (previewing(request, env)) return {
|
|
@@ -168,6 +183,7 @@ async function loginFailure(message, status, headers, context) {
|
|
|
168
183
|
});
|
|
169
184
|
}
|
|
170
185
|
async function startCustomerLogin(request, context) {
|
|
186
|
+
if (context.get(worker).env.ECOMIQ_PREVIEW === "1") return editorLoginForm("", null);
|
|
171
187
|
const url = new URL(request.url);
|
|
172
188
|
const next = safeNext(url.searchParams.get("next"));
|
|
173
189
|
const current = await customer(request, context);
|
|
@@ -222,6 +238,10 @@ async function startCustomerLogin(request, context) {
|
|
|
222
238
|
async function submitCustomerLogin(request, context) {
|
|
223
239
|
const rejected = rejectCrossOriginAction(request);
|
|
224
240
|
if (rejected) return rejected;
|
|
241
|
+
if (context.get(worker).env.ECOMIQ_PREVIEW === "1") {
|
|
242
|
+
const email = (await request.formData()).get("email");
|
|
243
|
+
return editorLoginForm(typeof email === "string" ? email.trim() : "", EDITOR_LOGIN_NOTICE);
|
|
244
|
+
}
|
|
225
245
|
const origin = new URL(request.url).origin;
|
|
226
246
|
const configuration = await store(context).upsertCustomerAuthConfiguration(origin);
|
|
227
247
|
const cookies = customerCookies(context.get(worker).env);
|
|
@@ -354,6 +374,10 @@ async function completeCustomerLogin(request, context) {
|
|
|
354
374
|
}
|
|
355
375
|
async function logout(request, context) {
|
|
356
376
|
const env = context.get(worker).env;
|
|
377
|
+
if (env.ECOMIQ_PREVIEW === "1") return redirect("/", {
|
|
378
|
+
status: 303,
|
|
379
|
+
headers: PRIVATE_HEADERS
|
|
380
|
+
});
|
|
357
381
|
const origin = new URL(request.url).origin;
|
|
358
382
|
const configuration = await store(context).upsertCustomerAuthConfiguration(origin);
|
|
359
383
|
if (configuration.redirectUri !== new URL("/account/callback", origin).href) throw new Error("El dominio de salida no corresponde a esta tienda.");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { apiCacheFetch, uncachedFetch } from "./api-cache-DsuIn5hX.js";
|
|
2
|
-
import { previewClient } from "./preview-
|
|
2
|
+
import { previewClient } from "./preview-JWdMO6kX.js";
|
|
3
3
|
import { productPreviewClient } from "./product-preview-BspMAecJ.js";
|
|
4
4
|
import { observeStorefrontClient } from "./telemetry-HuZXWBPi.js";
|
|
5
|
-
import { worker } from "./worker-
|
|
5
|
+
import { worker } from "./worker-cbXmLvfR.js";
|
|
6
6
|
import { data } from "react-router";
|
|
7
7
|
import { ApiError, GraphQLResponseError, createClient } from "@ecomiq/core";
|
|
8
8
|
import { z } from "zod";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/storefront-text.ts
|
|
2
2
|
async function loadStorefrontTranslations(language) {
|
|
3
3
|
const code = language.split("-")[0];
|
|
4
|
-
if (code === "en") return (await import("./storefront-text-en-
|
|
5
|
-
if (code === "pt") return (await import("./storefront-text-pt-
|
|
4
|
+
if (code === "en") return (await import("./storefront-text-en-DzYmdOuY.js")).default;
|
|
5
|
+
if (code === "pt") return (await import("./storefront-text-pt-CizClH0I.js")).default;
|
|
6
6
|
return {};
|
|
7
7
|
}
|
|
8
8
|
function storefrontText(translations, source, values = {}) {
|
|
@@ -419,6 +419,7 @@ const translations = {
|
|
|
419
419
|
"Completa la verificación antes de continuar.": "Complete verification before continuing.",
|
|
420
420
|
"No pudimos enviar el código. Intenta de nuevo en unos minutos.": "We couldn't send the code. Try again in a few minutes.",
|
|
421
421
|
"Solicita un código para continuar.": "Request a code to continue.",
|
|
422
|
+
"El ingreso de clientes solo funciona en la tienda publicada.": "Customer sign-in only works in the published store.",
|
|
422
423
|
"Ingresa el código de seis dígitos que enviamos a tu correo.": "Enter the six-digit code sent to your email.",
|
|
423
424
|
"Ingresa el código de tu aplicación de autenticación o uno de recuperación.": "Enter your authenticator app code or a recovery code.",
|
|
424
425
|
"No pudimos completar el acceso. Intenta de nuevo en unos minutos.": "We couldn't sign you in. Try again in a few minutes.",
|
|
@@ -1025,6 +1026,10 @@ const translations = {
|
|
|
1025
1026
|
"Guardado en favoritos": "Saved to favorites",
|
|
1026
1027
|
"Detalles del producto": "Product details",
|
|
1027
1028
|
"Cliente": "Customer",
|
|
1028
|
-
"Elegir": "Choose"
|
|
1029
|
+
"Elegir": "Choose",
|
|
1030
|
+
"Sin elegir": "None",
|
|
1031
|
+
"Elige al menos {value0}": "Choose at least {value0}",
|
|
1032
|
+
"Elige hasta {value0}": "Choose up to {value0}",
|
|
1033
|
+
"Personalización": "Customization"
|
|
1029
1034
|
};
|
|
1030
1035
|
export { translations as default };
|
|
@@ -419,6 +419,7 @@ const translations = {
|
|
|
419
419
|
"Completa la verificación antes de continuar.": "Conclua a verificação antes de continuar.",
|
|
420
420
|
"No pudimos enviar el código. Intenta de nuevo en unos minutos.": "Não foi possível enviar o código. Tente novamente em alguns minutos.",
|
|
421
421
|
"Solicita un código para continuar.": "Solicite um código para continuar.",
|
|
422
|
+
"El ingreso de clientes solo funciona en la tienda publicada.": "O acesso de clientes só funciona na loja publicada.",
|
|
422
423
|
"Ingresa el código de seis dígitos que enviamos a tu correo.": "Informe o código de seis dígitos enviado ao seu e-mail.",
|
|
423
424
|
"Ingresa el código de tu aplicación de autenticación o uno de recuperación.": "Informe o código do aplicativo autenticador ou um código de recuperação.",
|
|
424
425
|
"No pudimos completar el acceso. Intenta de nuevo en unos minutos.": "Não foi possível entrar. Tente novamente em alguns minutos.",
|
|
@@ -1025,6 +1026,10 @@ const translations = {
|
|
|
1025
1026
|
"Guardado en favoritos": "Salvo nos favoritos",
|
|
1026
1027
|
"Detalles del producto": "Detalhes do produto",
|
|
1027
1028
|
"Cliente": "Cliente",
|
|
1028
|
-
"Elegir": "Escolher"
|
|
1029
|
+
"Elegir": "Escolher",
|
|
1030
|
+
"Sin elegir": "Nenhuma",
|
|
1031
|
+
"Elige al menos {value0}": "Escolha pelo menos {value0}",
|
|
1032
|
+
"Elige hasta {value0}": "Escolha até {value0}",
|
|
1033
|
+
"Personalización": "Personalização"
|
|
1029
1034
|
};
|
|
1030
1035
|
export { translations as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-
|
|
1
|
+
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
2
2
|
import { money } from "./money-DtGOtDri.js";
|
|
3
|
-
import { PaymentDialogFrame } from "./payment-dialog-frame-
|
|
3
|
+
import { PaymentDialogFrame } from "./payment-dialog-frame-xtidt_eM.js";
|
|
4
4
|
import { confirmingPaymentUrl } from "./payment-return-5cjypwIw.js";
|
|
5
5
|
import { useNavigate } from "react-router";
|
|
6
6
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { loadSections, withSections } from "./sections-
|
|
2
|
-
import { worker } from "./worker-
|
|
1
|
+
import { loadSections, withSections } from "./sections-CgpjubkB.js";
|
|
2
|
+
import { worker } from "./worker-cbXmLvfR.js";
|
|
3
3
|
// src/templates.ts
|
|
4
4
|
const TEMPLATE = "ecomiqTemplate";
|
|
5
5
|
const NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readCatalog } from "./catalog-7gJ-l5hW.js";
|
|
2
2
|
import { documentUrl } from "./document-url-CGsAl5Tf.js";
|
|
3
|
-
import { store } from "./store-
|
|
3
|
+
import { store } from "./store-uU2gWdMY.js";
|
|
4
4
|
import { data, redirect } from "react-router";
|
|
5
5
|
import { sanitizeHtml } from "@ecomiq/core";
|
|
6
6
|
// src/urls.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { checkoutAddressDefaults, checkoutProgress, checkoutStep, defaultPaymentMethod, needsShipping } from "./checkout-
|
|
1
|
+
import { checkoutAddressDefaults, checkoutProgress, checkoutStep, defaultPaymentMethod, needsShipping } from "./checkout-DsI1MY14.js";
|
|
2
2
|
import { useCustomerCsrfToken } from "./customer-csrf-C1oDX-Py.js";
|
|
3
3
|
import { useFetcher, useNavigation, useSearchParams } from "react-router";
|
|
4
4
|
// src/use-checkout.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { findStripeWallet } from "./stripe-dialog-
|
|
1
|
+
import { findStripeWallet } from "./stripe-dialog-D88qfkUS.js";
|
|
2
2
|
import { usePaymentToken } from "./use-payment-token-CErx-tN-.js";
|
|
3
3
|
import { gathered } from "./checkout-form-CbOIdENC.js";
|
|
4
4
|
import { useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-
|
|
1
|
+
import { useStorefrontLocale, useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
|
|
2
2
|
import { money } from "./money-DtGOtDri.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
// src/voucher-payment.tsx
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cartCookie } from "./cart-D7DxZ2lD.js";
|
|
2
|
-
import "./preview-cart-
|
|
2
|
+
import "./preview-cart-COIP3Vfh.js";
|
|
3
3
|
import { productPreviewFrom, productPreviewResponse } from "./product-preview-BspMAecJ.js";
|
|
4
4
|
import { StorefrontSdkTiming, durationMetric } from "./telemetry-HuZXWBPi.js";
|
|
5
5
|
import { privateCustomerResponse, rejectCrossOriginAction, rejectCustomerCsrf } from "./request-security-CRsRMgwj.js";
|
|
6
|
-
import { seoResponse } from "./seo-
|
|
6
|
+
import { seoResponse } from "./seo-D9UdUMg9.js";
|
|
7
7
|
import { confirmingPaymentUrl } from "./payment-return-5cjypwIw.js";
|
|
8
8
|
import { RouterContextProvider, createContext, createRequestHandler } from "react-router";
|
|
9
9
|
import { STOREFRONT_CACHE_REVISION_HEADER, StorefrontCacheTokenSchema } from "@ecomiq/core/storefront-cache-revision";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecomiq/storefront",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Ecomiq para React Router: tienda, carrito, sesión de cliente y catálogo en un Worker",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"qrcode-generator": "^2.0.4",
|
|
95
95
|
"sharp": "^0.35.5",
|
|
96
96
|
"zod": "^4.6.6",
|
|
97
|
-
"@ecomiq/core": "^1.
|
|
97
|
+
"@ecomiq/core": "^1.1.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"react": "^19.2.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatOrderDate, type CustomerOrderDetail, type CustomerOrderLineItem, type OrderStep } from "@ecomiq/core";
|
|
1
|
+
import { formatOrderDate, lineUnitPrice, type CustomerOrderDetail, type CustomerOrderLineItem, type OrderStep } from "@ecomiq/core";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Form, Link, useNavigation } from "react-router";
|
|
4
4
|
import { Button } from "@theme/ui/button";
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
useOrderStepDetail,
|
|
17
17
|
type OrderRequestActionData,
|
|
18
18
|
} from "../entries/account";
|
|
19
|
+
import { ItemPersonalization } from "../entries/cart";
|
|
19
20
|
|
|
20
21
|
export const catalog: SectionCatalog = {
|
|
21
22
|
name: "Detalle del pedido",
|
|
@@ -119,8 +120,9 @@ function ShipmentCard({ shipment, currency }: { shipment: Shipment; currency: st
|
|
|
119
120
|
<p className="font-medium">{item.title}</p>
|
|
120
121
|
)}
|
|
121
122
|
{item.variantTitle ? <p className="text-sm text-muted-foreground">{item.variantTitle}</p> : null}
|
|
123
|
+
<ItemPersonalization modifiers={item.modifiers} formatPrice={(value) => money(value, currency, locale)} />
|
|
122
124
|
<p className="text-sm text-muted-foreground">
|
|
123
|
-
{money(item
|
|
125
|
+
{money(lineUnitPrice(item), currency, locale)} × {item.quantity}
|
|
124
126
|
</p>
|
|
125
127
|
</div>
|
|
126
128
|
<p className="text-sm font-medium">{money(item.total, currency, locale)}</p>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { lineTotal } from "@ecomiq/core";
|
|
1
2
|
import type { ComponentProps, CSSProperties, ReactNode, SelectHTMLAttributes } from "react";
|
|
2
3
|
import { Link, useRouteLoaderData } from "react-router";
|
|
3
4
|
import { Button } from "@theme/ui/button";
|
|
@@ -23,6 +24,7 @@ import {
|
|
|
23
24
|
type CheckoutData,
|
|
24
25
|
type CheckoutStep,
|
|
25
26
|
} from "../entries/checkout";
|
|
27
|
+
import { ItemPersonalization } from "../entries/cart";
|
|
26
28
|
|
|
27
29
|
export const catalog: SectionCatalog = {
|
|
28
30
|
name: "Finalizar compra",
|
|
@@ -240,9 +242,10 @@ export function Checkout({ data, result, ...root }: { data: CheckoutData; result
|
|
|
240
242
|
<span className="flex min-w-0 flex-1 flex-col">
|
|
241
243
|
<span className="font-medium">{item.title}</span>
|
|
242
244
|
{item.variantLabel && item.variantLabel !== item.title ? <span className="text-xs text-muted-foreground">{item.variantLabel}</span> : null}
|
|
245
|
+
<ItemPersonalization modifiers={item.modifiers} formatPrice={format} className="mt-0.5" />
|
|
243
246
|
{item.sellerName ? <span className="text-xs text-muted-foreground">{storefrontTranslate("Vendido por")} {item.sellerName}</span> : null}
|
|
244
247
|
</span>
|
|
245
|
-
<span className="tabular-nums">{format(item
|
|
248
|
+
<span className="tabular-nums">{format(lineTotal(item))}</span>
|
|
246
249
|
</li>
|
|
247
250
|
))}
|
|
248
251
|
</ul>
|
|
@@ -2,6 +2,7 @@ import { Form, Link, useNavigation } from "react-router";
|
|
|
2
2
|
import { Button } from "@theme/ui/button";
|
|
3
3
|
import { useStorefrontText, CustomerCsrfField, money, setting, type SectionCatalog, type SectionRoot } from "../index";
|
|
4
4
|
import { orderSummaryLines, type OrderDraftActionData, type OrderDraftData } from "../entries/order";
|
|
5
|
+
import { ItemPersonalization } from "../entries/cart";
|
|
5
6
|
|
|
6
7
|
export const catalog: SectionCatalog = {
|
|
7
8
|
name: "Pedido por pagar",
|
|
@@ -48,6 +49,7 @@ export function DraftInvoice({ loaderData, actionData, ...root }: { loaderData:
|
|
|
48
49
|
<span className="flex flex-1 flex-col gap-0.5">
|
|
49
50
|
<span className="font-medium">{item.title}</span>
|
|
50
51
|
{item.subtitle ? <span className="text-sm text-muted-foreground">{item.subtitle}</span> : null}
|
|
52
|
+
<ItemPersonalization modifiers={item.modifiers} formatPrice={price} />
|
|
51
53
|
<span className="text-sm text-muted-foreground tabular-nums">×{item.quantity}</span>
|
|
52
54
|
</span>
|
|
53
55
|
<span className="font-medium tabular-nums">{price(item.total)}</span>
|