@nuskin/ns-shop 7.0.7-cx24-70033.1 → 7.0.7
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
|
@@ -393,7 +393,7 @@ function _assembleChildSkus(requestData, options) {
|
|
|
393
393
|
if(personalOffer != null && productWithVariant.length > 0 && productWithVariant[0].variantSelected){
|
|
394
394
|
selectedVariants = productWithVariant[0].variantSelected;
|
|
395
395
|
}
|
|
396
|
-
if (personalOffer != null && selectedVariants && cs.skuId != selectedVariants[cs.productId] && (cs.type !== "BUNDLE" && cs.type
|
|
396
|
+
if (personalOffer != null && selectedVariants && cs.skuId != selectedVariants[cs.productId] && (cs.type !== "BUNDLE" && cs.type !== "OPTIONAL")) return null
|
|
397
397
|
const childSku =
|
|
398
398
|
(personalOffer != null && selectedVariants && selectedVariants[cs.productId] && config.MySite_graphql_active)
|
|
399
399
|
? {
|
|
@@ -142,15 +142,21 @@ const getAdrOverrideId = () => {
|
|
|
142
142
|
const _doNewExternalPaymentProcess = (order) => {
|
|
143
143
|
// We only redirect if there is a redirect Url.
|
|
144
144
|
if (order.redirectUrl) {
|
|
145
|
+
const redirectUrl = new URL(order.redirectUrl);
|
|
145
146
|
// The landing page should be the checkout page.
|
|
146
147
|
const protocol = window.location.href.split('://')[0];
|
|
147
148
|
const domain = UrlService.extractDomain();
|
|
148
149
|
const path = encodeURIComponent(CartService.getCheckoutPage({route: 'orderSummary'}));
|
|
149
150
|
|
|
151
|
+
// If we are on mynuskin.com we want to keep external payment on mynuskin.com. For developing localhost we don't want to stay on localhost
|
|
152
|
+
if (!domain.includes('localhost')) {
|
|
153
|
+
redirectUrl.hostname = window.location.hostname;
|
|
154
|
+
}
|
|
155
|
+
|
|
150
156
|
// Append the landing page URL
|
|
151
157
|
// Example of order.redirectUrl: "redirectUrl":
|
|
152
158
|
// "https://test.nuskin.com/external-payment/api/v1/redirect?orderId=NS002761827&verify=null&ofsOrderId=0149707745"
|
|
153
|
-
window.location = `${
|
|
159
|
+
window.location = `${redirectUrl.toString()}&landingUrl=${protocol}://${domain}${path}`;
|
|
154
160
|
}
|
|
155
161
|
};
|
|
156
162
|
|
package/src/salesEventService.js
CHANGED
|
@@ -152,7 +152,7 @@ async function getEventStatus(eventsToCheck = []) {
|
|
|
152
152
|
eventsToCheck.forEach((eventName) => {
|
|
153
153
|
let activeStatus = false;
|
|
154
154
|
const ticketInfo = eventTicketInfoMap[eventName];
|
|
155
|
-
if (ticketInfo.ticket) {
|
|
155
|
+
if (ticketInfo && ticketInfo.ticket) {
|
|
156
156
|
const status = _decodeStatus(ticketInfo.ticket.status);
|
|
157
157
|
if ((status.eventStatus === PRE_EVENT && status.preWaitTime <= 30000) ||
|
|
158
158
|
status.eventStatus === IN_EVENT) {
|