@nuskin/ns-shop 7.9.1-td-4379.3 → 7.9.1-td-4379.5

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.9.1-td-4379.3",
3
+ "version": "7.9.1-td-4379.5",
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": {
@@ -400,7 +400,7 @@ function goToCartPage() {
400
400
  } else if (!shoppingContext) {
401
401
  const sessionUrl = getSessionShopURL();
402
402
  if (sessionUrl) {
403
- url = `https://${env}nuskin.com/${sessionUrl}`;
403
+ url = `https://${env}nuskin.com${sessionUrl}`;
404
404
  }
405
405
  }
406
406
 
@@ -414,13 +414,13 @@ function getSessionShopURL() {
414
414
  const sessionStorefront = sessionStorage.getItem('storefront') ? JSON.parse(sessionStorage.getItem('storefront')) : null;
415
415
  let url;
416
416
 
417
- if (sessionStorefront && sessionStorefront.user && sessionStorefront.user.shopUrl) {
418
- if (shoppingContext && shoppingContext.context === "storefront") {
417
+ if (shoppingContext && sessionStorefront && sessionStorefront.user) {
418
+ if (shoppingContext.context === "storefront" && sessionStorefront.user.shopUrl) {
419
419
  const shopUrl = sessionStorefront.user.shopUrl;
420
- url = `${market.toLowerCase()}/${locale.toLowerCase()}/mysite/${shopUrl}/viewCart`;
421
- } else if (shoppingContext && shoppingContext.context === 'personal_offer' && sessionStorefront.user.sapId) {
420
+ url = `/${market.toLowerCase()}/${locale.toLowerCase()}/mysite/${shopUrl}/viewCart`;
421
+ } else if (shoppingContext.context === 'personal_offer' && sessionStorefront.user.sapId) {
422
422
  const sapId = sessionStorefront.user.sapId;
423
- url = `${market.toLowerCase()}/${locale.toLowerCase()}/personal-offer/${sapId}/viewCart`;
423
+ url = `/${market.toLowerCase()}/${locale.toLowerCase()}/personal-offer/${sapId}/viewCart`;
424
424
  }
425
425
  }
426
426