@nuskin/ns-shop 6.7.5 → 6.7.6

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": "6.7.5",
3
+ "version": "6.7.6",
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": {
@@ -90,7 +90,12 @@ async function addProductToEquinoxCart(options) {
90
90
  requestData = _assembleAdrProperties(requestData, options)
91
91
 
92
92
  if (options.product.inventory === "BACKORDER") {
93
- requestData.properties = {...requestData.properties, isBackOrdered: true}
93
+ requestData.properties = { ...requestData.properties, isBackOrdered: true }
94
+ }
95
+
96
+ //check all skus
97
+ if (requestData.skus.some(item => item.backOrdered)) {
98
+ requestData.properties = { ...requestData.properties, isBackOrdered: true };
94
99
  }
95
100
 
96
101
  const equinoxRequestOptions = {
@@ -146,7 +151,12 @@ async function addBundleToEquinoxCart(productBundleSkus = []) {
146
151
  bundleItem = _assembleChildSkus(bundleItem, { product: productItem })
147
152
 
148
153
  if (productItem.inventory === "BACKORDER") {
149
- bundleItem.properties = {...bundleItem.properties, isBackOrdered: true}
154
+ bundleItem.properties = { ...bundleItem.properties, isBackOrdered: true }
155
+ }
156
+
157
+ //check all skus
158
+ if (bundleItem.skus.some(item => item.backOrdered)) {
159
+ bundleItem.properties = { ...bundleItem.properties, isBackOrdered: true };
150
160
  }
151
161
 
152
162
  bundleItems.push(bundleItem)
@@ -207,7 +217,7 @@ async function getEquinoxRequestConfiguration() {
207
217
  const config = (await getConfiguration(['Equinox_Markets'])).Equinox_Markets;
208
218
 
209
219
  // Use MySite_API_Base_URLs if it is in MySite or MSCART
210
- const mySiteKongURL = (cartType === shoppingContextCartTypes.storefront || window.location.hostname.includes(".mynuskin.com")) ? config.MySite_API_Base_URLs :config.API_Base_URLs;
220
+ const mySiteKongURL = (cartType === shoppingContextCartTypes.storefront || window.location.hostname.includes(".mynuskin.com")) ? config.MySite_API_Base_URLs : config.API_Base_URLs;
211
221
 
212
222
  const equinoxMarket = {
213
223
  market_name: config.market_name,