@riosst100/pwa-marketplace 2.7.4 → 2.7.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.
- package/package.json +1 -1
- package/src/overwrites/peregrine/lib/talons/ProductFullDetail/useProductFullDetail.js +33 -1
- package/src/overwrites/venia-ui/lib/components/ProductOptions/option.js +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductOptions/tile.js +1 -1
- package/src/overwrites/venia-ui/lib/components/ProductOptions/tile.module.css +4 -1
package/package.json
CHANGED
|
@@ -248,6 +248,33 @@ const getConfigName = (product, optionCodes, optionSelections) => {
|
|
|
248
248
|
return value;
|
|
249
249
|
};
|
|
250
250
|
|
|
251
|
+
const getConfigSku = (product, optionCodes, optionSelections) => {
|
|
252
|
+
let value;
|
|
253
|
+
|
|
254
|
+
const { variants } = product;
|
|
255
|
+
const isConfigurable = isProductConfigurable(product);
|
|
256
|
+
|
|
257
|
+
const optionsSelected =
|
|
258
|
+
Array.from(optionSelections.values()).filter(value => !!value).length >
|
|
259
|
+
0;
|
|
260
|
+
|
|
261
|
+
if (!isConfigurable) {
|
|
262
|
+
value = product.name;
|
|
263
|
+
} else {
|
|
264
|
+
const item = findMatchingVariant({
|
|
265
|
+
optionCodes,
|
|
266
|
+
optionSelections,
|
|
267
|
+
variants
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
value = optionsSelected && item
|
|
271
|
+
? item.product.sku
|
|
272
|
+
: product.sku;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return value;
|
|
276
|
+
};
|
|
277
|
+
|
|
251
278
|
const attributeLabelCompare = (attribute1, attribute2) => {
|
|
252
279
|
const label1 = attribute1['attribute_metadata']['label'].toLowerCase();
|
|
253
280
|
const label2 = attribute2['attribute_metadata']['label'].toLowerCase();
|
|
@@ -450,6 +477,11 @@ export const useProductFullDetail = props => {
|
|
|
450
477
|
[product, optionCodes, optionSelections]
|
|
451
478
|
);
|
|
452
479
|
|
|
480
|
+
const productSku = useMemo(
|
|
481
|
+
() => getConfigSku(product, optionCodes, optionSelections),
|
|
482
|
+
[product, optionCodes, optionSelections]
|
|
483
|
+
);
|
|
484
|
+
|
|
453
485
|
// The map of ids to values (and their uids)
|
|
454
486
|
// For example:
|
|
455
487
|
// { "179" => [{ uid: "abc", value_index: 1 }, { uid: "def", value_index: 2 }]}
|
|
@@ -625,7 +657,7 @@ export const useProductFullDetail = props => {
|
|
|
625
657
|
name: productName,
|
|
626
658
|
price: productPrice?.final_price,
|
|
627
659
|
price_range: product?.price_range,
|
|
628
|
-
sku:
|
|
660
|
+
sku: productSku,
|
|
629
661
|
publish_status: product.publish_status,
|
|
630
662
|
term_and_conditions: product.term_and_conditions,
|
|
631
663
|
link_to_other_stores: product.link_to_other_stores,
|
|
@@ -67,7 +67,7 @@ const Option = props => {
|
|
|
67
67
|
|
|
68
68
|
return (
|
|
69
69
|
<div className={classes.root} data-cy="ProductOptions-Option-root">
|
|
70
|
-
<span className={classes.title}>{label}</span>
|
|
70
|
+
{/* <span className={classes.title}>{label}</span> */}
|
|
71
71
|
<ValueList
|
|
72
72
|
getItemKey={getItemKey}
|
|
73
73
|
selectedValue={initialSelection}
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
.variantImageSwatch {
|
|
20
20
|
width: 24px;
|
|
21
21
|
height: 24px;
|
|
22
|
+
display: table;
|
|
23
|
+
margin-bottom: 2px;
|
|
24
|
+
margin-right: 5px;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
.root:hover {
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
.label {
|
|
30
|
-
padding-left:
|
|
33
|
+
padding-left: 5px;
|
|
31
34
|
padding-right: 5px;
|
|
32
35
|
}
|
|
33
36
|
|