@nuskin/ns-shop 7.1.0 → 7.1.1-brw-4716.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-shop",
3
- "version": "7.1.0",
3
+ "version": "7.1.1-brw-4716.1",
4
4
  "description": "The description that will amaze and astound your audience when they read it",
5
5
  "main": "src/shop.js",
6
6
  "scripts": {
@@ -42,12 +42,14 @@ export default function CartItem(cartItemData) {
42
42
 
43
43
  // fix image paths for non-edge/firefox
44
44
  if (!isEdge && !isFirefox) {
45
- this.product.fullImage = this.product.fullImage
46
- ? `${this.product.fullImage.split("?")[0]}?format=pjpg`
47
- : undefined;
48
- this.product.thumbnail = this.product.thumbnail
49
- ? `${this.product.thumbnail.split("?")[0]}?format=pjpg`
50
- : undefined;
45
+ if (!this.product.fullImage.includes("media.nuskin.com/transform")) {
46
+ this.product.fullImage = this.product.fullImage
47
+ ? `${this.product.fullImage.split("?")[0]}?format=pjpg`
48
+ : undefined;
49
+ this.product.thumbnail = this.product.thumbnail
50
+ ? `${this.product.thumbnail.split("?")[0]}?format=pjpg`
51
+ : undefined;
52
+ }
51
53
  }
52
54
 
53
55
  this.qty = cartItemData.qty;
@@ -213,12 +213,14 @@ const handleDetailResponse = async (responseData, options) => {
213
213
 
214
214
  // fix image paths for non-edge/firefox
215
215
  if (!isEdge && !isFirefox) {
216
- retVal.product.fullImage = retVal.product.fullImage
217
- ? `${retVal.product.fullImage.split("?")[0]}?format=pjpg`
218
- : undefined;
219
- retVal.product.thumbnail = retVal.product.thumbnail
220
- ? `${retVal.product.thumbnail.split("?")[0]}?format=pjpg`
221
- : undefined;
216
+ if (!retVal.product.fullImage.includes("media.nuskin.com/transform")) {
217
+ retVal.product.fullImage = retVal.product.fullImage
218
+ ? `${retVal.product.fullImage.split("?")[0]}?format=pjpg`
219
+ : undefined;
220
+ retVal.product.thumbnail = retVal.product.thumbnail
221
+ ? `${retVal.product.thumbnail.split("?")[0]}?format=pjpg`
222
+ : undefined;
223
+ }
222
224
  }
223
225
  } else {
224
226
  retVal.success = false;
@@ -179,12 +179,14 @@ let ProductService = function() {
179
179
 
180
180
  // fix image paths for non-edge/firefox
181
181
  if (!isEdge && !isFirefox) {
182
- retVal.product.fullImage = retVal.product.fullImage
183
- ? `${retVal.product.fullImage.split("?")[0]}?format=pjpg`
184
- : undefined;
185
- retVal.product.thumbnail = retVal.product.thumbnail
186
- ? `${retVal.product.thumbnail.split("?")[0]}?format=pjpg`
187
- : undefined;
182
+ if (!retVal.product.fullImage.includes("media.nuskin.com/transform")) {
183
+ retVal.product.fullImage = retVal.product.fullImage
184
+ ? `${retVal.product.fullImage.split("?")[0]}?format=pjpg`
185
+ : undefined;
186
+ retVal.product.thumbnail = retVal.product.thumbnail
187
+ ? `${retVal.product.thumbnail.split("?")[0]}?format=pjpg`
188
+ : undefined;
189
+ }
188
190
  }
189
191
  } else {
190
192
  retVal.success = false;
@@ -136,7 +136,7 @@ const populateItem = (order, salesOrder, shipImmediate, includeSapItems) => {
136
136
  };
137
137
 
138
138
  const populateAttribution = (salesOrder) => {
139
- const sponsorId = util.getSponsorId();
139
+ const sponsorId = util.getSponsorId();
140
140
 
141
141
  if (sponsorId) {
142
142
  if (sponsorId.match(/^[A-Z]{2}(:?\d{7}|\d{8})$/)) {
@@ -149,6 +149,16 @@ const populateAttribution = (salesOrder) => {
149
149
  } else {
150
150
  console.error('Invalid sponsorId', sponsorId);
151
151
  }
152
+ } else {
153
+ const guestSponsorId = UserService.getUser();
154
+ if(guestSponsorId.sponsorId == 'RETFLOAT' || guestSponsorId.sponsorId == 'NSHOUSE'){
155
+ salesOrder.Shipping.ShippingParty.push({
156
+ Type: "RTL_SELLER",
157
+ ShippingMemberID: 'NSHOUSE',
158
+ ShippingAddress: {
159
+ }
160
+ });
161
+ }
152
162
  }
153
163
  }
154
164
 
@@ -509,12 +519,14 @@ async function addSapItem(newItem, sapItem, sapSkus, adr, isAdrItem, replace) {
509
519
 
510
520
  // fix image paths for non-edge/firefox
511
521
  if (!isEdge && !isFirefox) {
512
- product.fullImage = product.fullImage
513
- ? `${product.fullImage.split("?")[0]}?format=pjpg`
514
- : undefined;
515
- product.thumbnail = product.thumbnail
516
- ? `${product.thumbnail.split("?")[0]}?format=pjpg`
517
- : undefined;
522
+ if (!product.fullImage.includes("media.nuskin.com/transform")) {
523
+ product.fullImage = product.fullImage
524
+ ? `${product.fullImage.split("?")[0]}?format=pjpg`
525
+ : undefined;
526
+ product.thumbnail = product.thumbnail
527
+ ? `${product.thumbnail.split("?")[0]}?format=pjpg`
528
+ : undefined;
529
+ }
518
530
  }
519
531
 
520
532
  // Try to update the count, flavor, shade, size, and product points values for the SapItem;
@@ -278,12 +278,14 @@ let productSearchService = function() {
278
278
 
279
279
  // fix image paths for non-edge/firefox
280
280
  if (!isEdge && !isFirefox) {
281
- addProduct.fullImage = addProduct.fullImage
282
- ? `${addProduct.fullImage.split("?")[0]}?format=pjpg`
283
- : undefined;
284
- addProduct.thumbnail = addProduct.thumbnail
285
- ? `${addProduct.thumbnail.split("?")[0]}?format=pjpg`
286
- : undefined;
281
+ if (!addProduct.fullImage.includes("media.nuskin.com/transform")) {
282
+ addProduct.fullImage = addProduct.fullImage
283
+ ? `${addProduct.fullImage.split("?")[0]}?format=pjpg`
284
+ : undefined;
285
+ addProduct.thumbnail = addProduct.thumbnail
286
+ ? `${addProduct.thumbnail.split("?")[0]}?format=pjpg`
287
+ : undefined;
288
+ }
287
289
  }
288
290
 
289
291
  // set price type
@@ -557,12 +559,14 @@ let productSearchService = function() {
557
559
 
558
560
  // fix image paths for non-edge/firefox
559
561
  if (!isEdge && !isFirefox) {
560
- addProduct.fullImage = addProduct.fullImage
561
- ? `${addProduct.fullImage.split("?")[0]}?format=pjpg`
562
- : undefined;
563
- addProduct.thumbnail = addProduct.thumbnail
564
- ? `${addProduct.thumbnail.split("?")[0]}?format=pjpg`
565
- : undefined;
562
+ if (!addProduct.fullImage.includes("media.nuskin.com/transform")) {
563
+ addProduct.fullImage = addProduct.fullImage
564
+ ? `${addProduct.fullImage.split("?")[0]}?format=pjpg`
565
+ : undefined;
566
+ addProduct.thumbnail = addProduct.thumbnail
567
+ ? `${addProduct.thumbnail.split("?")[0]}?format=pjpg`
568
+ : undefined;
569
+ }
566
570
  }
567
571
 
568
572
  const priceType = getCachedConfigField('showWholeSalePricing') && !AccountManager.isLoggedIn()