@nuskin/ns-product-lib 2.6.1-cx24-3607.2 → 2.6.1-cx24-3607.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/productData.js +5 -17
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [2.6.1-cx24-3607.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3607.2...v2.6.1-cx24-3607.3) (2023-03-16)
|
2
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* check for imageURL ([5d56bae](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/5d56baeb4c148cc667cc3c9321fb72e87216c921))
|
7
|
+
|
1
8
|
## [2.6.1-cx24-3607.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3607.1...v2.6.1-cx24-3607.2) (2023-03-16)
|
2
9
|
|
3
10
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -129,15 +129,9 @@ const ProductData = {
|
|
129
129
|
*/
|
130
130
|
eqProductVariantMapper: function (eqVariant) {
|
131
131
|
|
132
|
-
let imageURL = eqVariant.properties.imageURL;
|
133
|
-
|
134
|
-
let thumbnailImage = ''
|
132
|
+
let imageURL = eqVariant.properties.imageURL ? eqVariant.properties.imageURL : '';
|
133
|
+
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
135
134
|
|
136
|
-
if (imageURL.includes('contentstack')) {
|
137
|
-
thumbnailImage = imageURL + '?width=40'
|
138
|
-
} else {
|
139
|
-
thumbnailImage = imageURL.replace(regex, '40.40')
|
140
|
-
}
|
141
135
|
|
142
136
|
const { eventName, eventLabels, computedPrice, defaultProductPrice } = this.getEqProductPromotions(eqVariant);
|
143
137
|
const productPrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Regular Price"];
|
@@ -351,15 +345,9 @@ const ProductData = {
|
|
351
345
|
for (const productData of productDataResponse) {
|
352
346
|
try {
|
353
347
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
354
|
-
let imageURL = product.properties.imageURL;
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
if (imageURL.includes('contentstack')) {
|
359
|
-
thumbnailImage = imageURL + '?width=40'
|
360
|
-
} else {
|
361
|
-
thumbnailImage = imageURL.replace(regex, '40.40')
|
362
|
-
}
|
348
|
+
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
349
|
+
let thumbnailImage = imageURL ? imageURL + '?width=40' : ''
|
350
|
+
|
363
351
|
|
364
352
|
if (productData.sku && productData.sku.length > 1) {
|
365
353
|
// exclude base product from variants
|