@plurix/ecom-components 1.6.0-commerce.3 → 1.6.0-commerce.5
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.
|
@@ -16,9 +16,9 @@ const Y = ({
|
|
|
16
16
|
isOpen: h,
|
|
17
17
|
environment: y,
|
|
18
18
|
setIsOpen: m,
|
|
19
|
-
saveSelectedSimilarProduct:
|
|
19
|
+
saveSelectedSimilarProduct: d
|
|
20
20
|
}) => {
|
|
21
|
-
const [b, F] = c(), [O, a] = c(!1),
|
|
21
|
+
const [b, F] = c(), [O, a] = c(!1), s = y === "io", { genericTaggingEvent: P } = _(), [r, e] = c({ productId: "" });
|
|
22
22
|
return w(() => {
|
|
23
23
|
(async () => {
|
|
24
24
|
a(!0);
|
|
@@ -26,7 +26,7 @@ const Y = ({
|
|
|
26
26
|
const t = await N({
|
|
27
27
|
postalCode: p,
|
|
28
28
|
selectedItem: o,
|
|
29
|
-
isIO:
|
|
29
|
+
isIO: s
|
|
30
30
|
});
|
|
31
31
|
F(t == null ? void 0 : t.products);
|
|
32
32
|
} finally {
|
|
@@ -36,7 +36,7 @@ const Y = ({
|
|
|
36
36
|
var t, l;
|
|
37
37
|
a(!0);
|
|
38
38
|
try {
|
|
39
|
-
const u = await J(g), i = ((l = (t = u == null ? void 0 : u.customData) == null ? void 0 : t.customApps) == null ? void 0 : l.find((C) => C.id === "janis")) || null;
|
|
39
|
+
const u = await J(g, s), i = ((l = (t = u == null ? void 0 : u.customData) == null ? void 0 : t.customApps) == null ? void 0 : l.find((C) => C.id === "janis")) || null;
|
|
40
40
|
let f = {};
|
|
41
41
|
i != null && i.fields.idSubstitutionCriterias && (f = JSON.parse(i == null ? void 0 : i.fields.idSubstitutionCriterias));
|
|
42
42
|
const x = o == null ? void 0 : o.productOriginId;
|
|
@@ -56,7 +56,7 @@ const Y = ({
|
|
|
56
56
|
A,
|
|
57
57
|
{
|
|
58
58
|
saveSelectedSimilarProduct: () => {
|
|
59
|
-
r && (
|
|
59
|
+
r && (d == null || d(r), P("salvar_substituto", {
|
|
60
60
|
name: o.name,
|
|
61
61
|
replacement_item: r == null ? void 0 : r.name
|
|
62
62
|
})), m(!1);
|
|
@@ -66,8 +66,8 @@ const Y = ({
|
|
|
66
66
|
children: O ? /* @__PURE__ */ n(
|
|
67
67
|
E,
|
|
68
68
|
{
|
|
69
|
-
width:
|
|
70
|
-
height:
|
|
69
|
+
width: s ? "100%" : "90%",
|
|
70
|
+
height: s ? 600 : 425,
|
|
71
71
|
backgroundColor: "var(--color-grayScale-faded)",
|
|
72
72
|
margin: "auto",
|
|
73
73
|
animation: !0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getOrderForm: (orderFormId: string) => Promise<any>;
|
|
1
|
+
export declare const getOrderForm: (orderFormId: string, isIO: boolean) => Promise<any>;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import o from "axios";
|
|
2
|
+
const c = async (t, a) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
if (a) {
|
|
5
|
+
const { data: e } = await o.post(
|
|
6
|
+
`/api/checkout/pub/orderForm/${t}`
|
|
7
|
+
);
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
const { data: r } = await o.post("/api/proxy", {
|
|
11
|
+
targetUrl: `/api/checkout/pub/orderForm/${t}`,
|
|
6
12
|
method: "GET",
|
|
7
13
|
headers: {
|
|
8
14
|
"Content-Type": "application/json",
|
|
@@ -15,5 +21,5 @@ const e = async (o) => {
|
|
|
15
21
|
}
|
|
16
22
|
};
|
|
17
23
|
export {
|
|
18
|
-
|
|
24
|
+
c as getOrderForm
|
|
19
25
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import n from "axios";
|
|
2
|
-
const
|
|
2
|
+
const O = async ({
|
|
3
3
|
postalCode: a,
|
|
4
|
-
isIO:
|
|
4
|
+
isIO: p,
|
|
5
5
|
selectedItem: r
|
|
6
6
|
}) => {
|
|
7
7
|
try {
|
|
8
|
-
if (
|
|
8
|
+
if (p) {
|
|
9
9
|
const { data: o } = await n.get(
|
|
10
|
-
|
|
11
|
-
), { similarProducts:
|
|
12
|
-
return
|
|
13
|
-
(
|
|
10
|
+
`/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`
|
|
11
|
+
), { similarProducts: u } = o;
|
|
12
|
+
return u.find(
|
|
13
|
+
(c) => c.productOrigin === (r == null ? void 0 : r.productOriginId)
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
const { data: i } = await n.post(
|
|
17
|
-
"
|
|
17
|
+
"/api/proxy",
|
|
18
18
|
{
|
|
19
19
|
targetUrl: `/_v/commerce/products/productsSimilar?postalCode=${a}&skus=${r == null ? void 0 : r.productOriginId}&field=sku`,
|
|
20
20
|
method: "GET",
|
|
@@ -23,8 +23,8 @@ const h = async ({
|
|
|
23
23
|
Accept: "application/json"
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
), { similarProducts:
|
|
27
|
-
return
|
|
26
|
+
), { similarProducts: s } = i;
|
|
27
|
+
return s.find(
|
|
28
28
|
(o) => o.productOrigin === r.productOriginId
|
|
29
29
|
);
|
|
30
30
|
} catch (i) {
|
|
@@ -32,5 +32,5 @@ const h = async ({
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
O as getProductsSimilars
|
|
36
36
|
};
|