@nuskin/ns-shop 7.8.2 → 7.8.3-pa-933.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.8.2",
3
+ "version": "7.8.3-pa-933.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": {
@@ -762,7 +762,13 @@ async function checkProductLanguages() {
762
762
  const promises = [];
763
763
  const changeditems = []
764
764
  _getCart().getItems({cartItems: true}).forEach((cartItem) => {
765
- if (runConfig.language !== cartItem.product.lang) {
765
+ // if there is no language (lang) set on the product this is a variant and variants
766
+ // do not have this set. It likely has the correct language used for product data.
767
+ if (!cartItem.product.lang) {
768
+ cartItem.product.lang = runConfig.language;
769
+ promises.push(Promise.resolve({product: cartItem.product}));
770
+ changeditems.push(cartItem);
771
+ } else if (runConfig.language !== cartItem.product.lang) {
766
772
  promises.push(ProductService.getProductBySku({
767
773
  cntryCd: runConfig.country,
768
774
  language: runConfig.language,