@nuskin/ns-shop 7.0.5-cx1-13272.3 → 7.0.5-cx1-13272.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-shop",
3
- "version": "7.0.5-cx1-13272.3",
3
+ "version": "7.0.5-cx1-13272.4",
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": {
@@ -236,7 +236,9 @@ async function checkForMissingEventNames(order) {
236
236
  // check to see if cart item has eventName but sapItem does not.
237
237
  const orderItems = cart.getItems({cartOrderItems: true});
238
238
  orderItems.map((item) => {
239
- const sapItem = order.sapItems.find((sapItem) => sapItem.key === item.key);
239
+ const sapItem = order.sapItems.find((sapItem) => (
240
+ sapItem.product.sku === item.product.sku && sapItem.adr === item.adr
241
+ ));
240
242
  if (sapItem && item.eventName && !sapItem.eventName)
241
243
  outOfSync = true;
242
244
  });
@@ -544,7 +544,8 @@ async function addSapItem(newItem, sapItem, sapSkus, adr, isAdrItem, replace) {
544
544
  })
545
545
 
546
546
  // eventName would have gotten nulled out. Fix it here.
547
- product.eventName = savedEventName;
547
+ if (item?.product)
548
+ item.product.eventName = savedEventName;
548
549
 
549
550
  return item;
550
551
  }