@nuskin/ns-shop 7.1.1-pur-813.6 → 7.1.2
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
package/src/cart/cartItem.js
CHANGED
|
@@ -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
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
if (this.product.fullImage && !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
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
216
|
+
if (retVal.product.fullImage && !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
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
if (retVal.product.fullImage && !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
|
|
|
@@ -508,12 +518,14 @@ async function addSapItem(newItem, sapItem, sapSkus, adr, isAdrItem, replace) {
|
|
|
508
518
|
|
|
509
519
|
// fix image paths for non-edge/firefox
|
|
510
520
|
if (!isEdge && !isFirefox) {
|
|
511
|
-
product.fullImage
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
521
|
+
if (product.fullImage && !product.fullImage.includes("media.nuskin.com/transform")) {
|
|
522
|
+
product.fullImage = product.fullImage
|
|
523
|
+
? `${product.fullImage.split("?")[0]}?format=pjpg`
|
|
524
|
+
: undefined;
|
|
525
|
+
product.thumbnail = product.thumbnail
|
|
526
|
+
? `${product.thumbnail.split("?")[0]}?format=pjpg`
|
|
527
|
+
: undefined;
|
|
528
|
+
}
|
|
517
529
|
}
|
|
518
530
|
|
|
519
531
|
// 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
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
281
|
+
if (addProduct.fullImage && !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
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
562
|
+
if (addProduct.fullImage && !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()
|
|
@@ -171,23 +171,14 @@ let PickupUtil = function() {
|
|
|
171
171
|
|
|
172
172
|
function loadShipMethods() {
|
|
173
173
|
const order = Order.fromSalesOrderRequest(OrderAdapter.populateSalesOrder('SIMULATE'));
|
|
174
|
-
|
|
175
|
-
const postalCode = order.shippingPostalCode;
|
|
176
|
-
const {metapackMarket, metapackZipExclusions} = getCachedConfiguration('Checkout');
|
|
174
|
+
const {metapackMarket} = getCachedConfiguration('Checkout');
|
|
177
175
|
|
|
178
176
|
if (metapackMarket) {
|
|
179
|
-
let includePickupPoints = true;
|
|
180
|
-
for (const zipRegEx of metapackZipExclusions || []) {
|
|
181
|
-
const regEx = new RegExp(zipRegEx);
|
|
182
|
-
includePickupPoints = includePickupPoints && !postalCode.match(regEx);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
177
|
const runConfig = RunConfigService.getRunConfig();
|
|
186
178
|
promise = axios.post(
|
|
187
179
|
getUrl(),
|
|
188
180
|
{
|
|
189
181
|
order,
|
|
190
|
-
pudo: includePickupPoints,
|
|
191
182
|
orderValue: getOrderValue(),
|
|
192
183
|
dangerousGoods: CartService.hasDangerousGoods(),
|
|
193
184
|
language: runConfig.language,
|