commit
85f38fe939
3 changed files with 26 additions and 6 deletions
|
|
@ -3,15 +3,33 @@ import { queryStrings } from "@/constants/query-strings";
|
|||
import store from "@/store";
|
||||
import { storeMutations } from "@/constants/store-mutations";
|
||||
import { updateOrCreateFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||
|
||||
export async function consumeReferralQuerystrings() {
|
||||
const referralNumber = getQuerystringParameter(queryStrings.REFERRAL_NUMBER);
|
||||
const parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT);
|
||||
const correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID);
|
||||
var referralNumber = getQuerystringParameter(queryStrings.REFERRAL_NUMBER);
|
||||
var parentAccount = getQuerystringParameter(queryStrings.PARENT_ACCOUNT);
|
||||
var correlationId = getQuerystringParameter(queryStrings.CORRELATION_ID);
|
||||
var referralDate = null;
|
||||
|
||||
// If no referral number in querystring, check if heritage funnel updated last.
|
||||
// This would indicate a customer that went to heritage but did not return through the
|
||||
// normal route. ie: left the site in search of a discount and returned without querystrings.
|
||||
const didHeritageFunnelUpdateLast = getFunnelCookie()?.DidHeritageFunnelUpdateLast;
|
||||
if (didHeritageFunnelUpdateLast && !referralNumber) {
|
||||
referralNumber = getFunnelCookie().ReferralNumber;
|
||||
parentAccount = getFunnelCookie().ReferralParentAccountNumber;
|
||||
correlationId = getFunnelCookie().ReferralCorrelationId;
|
||||
referralDate = getFunnelCookie().ReferralDate;
|
||||
}
|
||||
|
||||
if (referralNumber) {
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
|
||||
store.commit(storeMutations.UPDATE_PARENT_ACCT_NUMBER, parentAccount);
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_CORRELATION_ID, correlationId);
|
||||
|
||||
if (referralDate) {
|
||||
store.commit(storeMutations.UPDATE_REFERRAL_DATE, referralDate);
|
||||
}
|
||||
// log(" --update cookie");
|
||||
updateOrCreateFunnelCookie();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@ import { queryStrings } from "@/constants/query-strings";
|
|||
import { consumeReferralQuerystrings } from "@/router/methods/helpers/consume-referral-info";
|
||||
import { loadSessionIfPresent } from "@/helpers/heritage-integration/order-helper";
|
||||
import { routeData } from "@/router/constants/routes";
|
||||
import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
||||
|
||||
export async function handleHeritageReturn(to, from) {
|
||||
const fromHeritageFlag = to.query[queryStrings.FROM_HERITAGE];
|
||||
const didHeritageFunnelUpdateLast = getFunnelCookie()?.DidHeritageFunnelUpdateLast;
|
||||
|
||||
if (fromHeritageFlag) {
|
||||
if (fromHeritageFlag || didHeritageFunnelUpdateLast) {
|
||||
// Get new referral info from querystring in case passed there.
|
||||
await consumeReferralQuerystrings();
|
||||
|
||||
|
|
|
|||
|
|
@ -123,8 +123,8 @@ $body-color: $gray-600;
|
|||
|
||||
//Fonts
|
||||
$font-family-sans-serif: UrbanistRegular, Arial, Helvetica, sans-serif;
|
||||
$font-family-monospace:
|
||||
UrbanistRegular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
$font-family-monospace: UrbanistRegular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
|
||||
monospace;
|
||||
// stylelint-enable value-keyword-case
|
||||
$font-family-base: $font-family-sans-serif;
|
||||
$font-family-code: $font-family-monospace;
|
||||
|
|
|
|||
Loading…
Reference in a new issue