@nuskin/product-components 3.3.3 → 3.3.4
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/CHANGELOG.md +7 -0
- package/mixins/NsProductMixin.js +43 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.3.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.3...v3.3.4) (2023-03-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Fix
|
|
5
|
+
|
|
6
|
+
* Show variants drop down ([4fbbb8b](https://code.tls.nuskin.io/ns-am/ux/product-components/commit/4fbbb8b1ea2fd74bf0d643ee80a3df411027a9d0))
|
|
7
|
+
|
|
1
8
|
## [3.3.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.3.2...v3.3.3) (2023-03-23)
|
|
2
9
|
|
|
3
10
|
|
package/mixins/NsProductMixin.js
CHANGED
|
@@ -30,6 +30,19 @@ import { ProductDataService } from "@nuskin/ns-product";
|
|
|
30
30
|
const PENDING_FAVORITE = "pendingFavorite";
|
|
31
31
|
const KEY_BREADCRUMB_BACK = "breadcrumbBack";
|
|
32
32
|
|
|
33
|
+
const configMapsToLoad = [
|
|
34
|
+
"Url",
|
|
35
|
+
"Basic",
|
|
36
|
+
"Shopping",
|
|
37
|
+
"ADP",
|
|
38
|
+
"Cart",
|
|
39
|
+
"Loyalty",
|
|
40
|
+
"Checkout"
|
|
41
|
+
];
|
|
42
|
+
getConfiguration(configMapsToLoad).then(() =>
|
|
43
|
+
console.log("ns-shop config loaded")
|
|
44
|
+
);
|
|
45
|
+
|
|
33
46
|
/**
|
|
34
47
|
* NsProductMixin
|
|
35
48
|
*
|
|
@@ -206,7 +219,9 @@ const NsProductMixin = {
|
|
|
206
219
|
|
|
207
220
|
featureFlags: this.$NsProductFeatureFlagsService.featureFlags,
|
|
208
221
|
|
|
209
|
-
activeSalesEvents: []
|
|
222
|
+
activeSalesEvents: [],
|
|
223
|
+
|
|
224
|
+
showVariantFromEq: false
|
|
210
225
|
};
|
|
211
226
|
},
|
|
212
227
|
computed: {
|
|
@@ -260,7 +275,13 @@ const NsProductMixin = {
|
|
|
260
275
|
return false;
|
|
261
276
|
},
|
|
262
277
|
showVariantSelector() {
|
|
263
|
-
|
|
278
|
+
if (this.showVariantFromEq) {
|
|
279
|
+
return !this.hideVariantSelector;
|
|
280
|
+
} else {
|
|
281
|
+
return (
|
|
282
|
+
!this.hideVariantSelector && (this.isBaseSku || this.isVariantSku)
|
|
283
|
+
);
|
|
284
|
+
}
|
|
264
285
|
},
|
|
265
286
|
showExclusiveOfferMessage() {
|
|
266
287
|
return !!(
|
|
@@ -398,6 +419,26 @@ const NsProductMixin = {
|
|
|
398
419
|
this.product = product;
|
|
399
420
|
}
|
|
400
421
|
|
|
422
|
+
if (
|
|
423
|
+
product.equinoxProductId != undefined &&
|
|
424
|
+
product.equinoxProductId.length > 0
|
|
425
|
+
) {
|
|
426
|
+
let variantsArr = Object.values(product.variants);
|
|
427
|
+
if (product.variants && variantsArr.length) {
|
|
428
|
+
this.variants = product.getVariantsList();
|
|
429
|
+
this.baseSku = product.sku;
|
|
430
|
+
this.baseProduct = product;
|
|
431
|
+
if (
|
|
432
|
+
this.activeSku === product.sku &&
|
|
433
|
+
this.loadFirstVariant &&
|
|
434
|
+
this.variants.length > 0
|
|
435
|
+
) {
|
|
436
|
+
this.activeSku = this.variants[0].sku;
|
|
437
|
+
}
|
|
438
|
+
this.showVariantFromEq = true;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
401
442
|
this.appendTranslations({
|
|
402
443
|
variantType: product.variantType,
|
|
403
444
|
variantDropdownLabel: product.variantDropdownLabel,
|
|
@@ -920,7 +961,6 @@ const NsProductMixin = {
|
|
|
920
961
|
const country = RunConfigService.getRunConfig().country;
|
|
921
962
|
getConfiguration(["Equinox_Markets"]).then(config => {
|
|
922
963
|
const countryCode = config.Equinox_Markets.country_code;
|
|
923
|
-
|
|
924
964
|
if (
|
|
925
965
|
countryCode === country &&
|
|
926
966
|
equinoxLocalStorage.isEquinoxEnabled()
|
|
@@ -928,7 +968,6 @@ const NsProductMixin = {
|
|
|
928
968
|
ProductDataService.getProductData(options.sku)
|
|
929
969
|
.then(productData => {
|
|
930
970
|
options.product = new ShopProduct(productData.products[0]);
|
|
931
|
-
|
|
932
971
|
options.add = {
|
|
933
972
|
item: {
|
|
934
973
|
qty: options.qty
|