@nuskin/ns-shop 7.1.1-pur-813.2 → 7.1.1-pur-813.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/package.json +1 -1
- package/src/cart/cartService.js +21 -21
- package/src/order/orderAdapter.js +4 -6
package/package.json
CHANGED
package/src/cart/cartService.js
CHANGED
|
@@ -682,30 +682,30 @@ function minAdrPsvMet() {
|
|
|
682
682
|
return retVal;
|
|
683
683
|
}
|
|
684
684
|
|
|
685
|
-
function checkProductLanguages() {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
};
|
|
691
|
-
|
|
692
|
-
_getCart().getItems({cartItems: true}).forEach(_cartItem => {
|
|
693
|
-
let cartItem = _cartItem;
|
|
694
|
-
|
|
685
|
+
async function checkProductLanguages() {
|
|
686
|
+
const runConfig = RunConfigService.getRunConfig(null);
|
|
687
|
+
const promises = [];
|
|
688
|
+
const changeditems = []
|
|
689
|
+
_getCart().getItems({cartItems: true}).forEach((cartItem) => {
|
|
695
690
|
if (runConfig.language !== cartItem.product.lang) {
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
.
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
cart.changeProduct(cartItem.key, response.product);
|
|
704
|
-
setCart(cart);
|
|
705
|
-
}
|
|
706
|
-
});
|
|
691
|
+
promises.push(ProductService.getProductBySku({
|
|
692
|
+
cntryCd: runConfig.country,
|
|
693
|
+
language: runConfig.language,
|
|
694
|
+
sku: cartItem.product.sku,
|
|
695
|
+
priceType: cartItem.product.priceType
|
|
696
|
+
}));
|
|
697
|
+
changeditems.push(cartItem);
|
|
707
698
|
}
|
|
708
699
|
});
|
|
700
|
+
|
|
701
|
+
if (promises.length > 0) {
|
|
702
|
+
const results = await Promise.all(promises);
|
|
703
|
+
let cart = _getCart();
|
|
704
|
+
results.forEach((result, i) => {
|
|
705
|
+
cart.changeProduct(changeditems[i].key, result.product);
|
|
706
|
+
});
|
|
707
|
+
setCart(cart);
|
|
708
|
+
}
|
|
709
709
|
}
|
|
710
710
|
|
|
711
711
|
function scanQualifiedCnt() {
|
|
@@ -153,12 +153,10 @@ const populateAttribution = (salesOrder) => {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
const populateShipping = (order, salesOrder) => {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
code = method.Code;
|
|
161
|
-
}
|
|
156
|
+
const user = UserService.getUser();
|
|
157
|
+
const defaultCode = getCachedConfigField('defaultShipMethod');
|
|
158
|
+
const method = order.selectedShippingMethod;
|
|
159
|
+
const code = method ? method.Code : defaultCode;
|
|
162
160
|
|
|
163
161
|
//code = (util.countryCode === 'ZA') ? (order.selectedAddress.addressType == "home" ? "ZH" : "ST") : code;
|
|
164
162
|
|