diff --git a/blocks/found-pet-report/found-pet-report.js b/blocks/found-pet-report/found-pet-report.js index 953f5aee..310daded 100644 --- a/blocks/found-pet-report/found-pet-report.js +++ b/blocks/found-pet-report/found-pet-report.js @@ -1,5 +1,6 @@ import { jsx, loadScript } from '../../scripts/scripts.js'; import { getConfigValue } from '../../scripts/configs.js'; +import { isCanada } from '../../scripts/lib-franklin.js'; async function executeSubmit(block, requestBody) { const reportLostEndpoint = await getConfigValue('found-pet-endpoint'); @@ -15,7 +16,8 @@ async function executeSubmit(block, requestBody) { }); if (response.ok) { - window.location.href = '/lost-pet-protection/report-lost-found-pet/thank-you'; + const urlPath = isCanada ? '/ca/lost-pet-protection/report-lost-found-pet/thank-you' : '/lost-pet-protection/report-lost-found-pet/thank-you'; + window.location.href = urlPath; } else { form.classList.add('submission-message'); form.innerHTML = 'There was an error with your submission. Please try again.'; diff --git a/blocks/plans-quote/costco-promo.js b/blocks/plans-quote/costco-promo.js index 0fff91d8..2912816f 100644 --- a/blocks/plans-quote/costco-promo.js +++ b/blocks/plans-quote/costco-promo.js @@ -1,19 +1,18 @@ import { PET_PLANS_ANNUAL_URL, - LS_KEY_FIGO_COSTCO, + LS_KEY_COSTCO_FIGO, } from '../../scripts/24petwatch-utils.js'; import APIClient, { getAPIBaseUrl } from '../../scripts/24petwatch-api.js'; import { getConfigValue } from '../../scripts/configs.js'; export const COSTCO_FIGO_PROMO_ITEMS = { policyIdKey: 'poid', - subId: 'SBSUN000016', + subId: 'COSTCOFIGO', }; // set eligibility flag based on the following values const eligibilityCriteria = { level: ['Executive'], - type: ['Costco', 'Employee-family'], status: 'Active', policyStatus: ['Future', 'Active'], }; @@ -21,7 +20,7 @@ const eligibilityCriteria = { const apiBaseUrl = await getAPIBaseUrl(); const APIClientObj = new APIClient(apiBaseUrl); const costcoFigoService = await getConfigValue('costco-figo-proxy'); -const costcoFigoStoredData = localStorage.getItem(LS_KEY_FIGO_COSTCO); +const costcoFigoStoredData = localStorage.getItem(LS_KEY_COSTCO_FIGO); const costcoFigoStoredValues = costcoFigoStoredData ? JSON.parse(costcoFigoStoredData) : {}; const costcoFigosubId = COSTCO_FIGO_PROMO_ITEMS.subId; const hasCostcoFigoStored = costcoFigoStoredData !== null; @@ -75,13 +74,11 @@ async function isCostcoFigoEligible(policyId) { const record = await getCostcoPolicyData(policyId); if (record) { const status = record.Status__c ?? null; - const type = record.Type__c ?? null; const level = record.Level__c ?? null; const policyStatus = record.Insurance_Policy__r?.Status ?? null; if (status === eligibilityCriteria.status && eligibilityCriteria.level.includes(level) - && eligibilityCriteria.type.includes(type) && eligibilityCriteria.policyStatus.includes(policyStatus)) { eligibilityFlag = true; } @@ -113,7 +110,7 @@ export async function checkCostcoFigoPromo(policyId, countryCode) { isEligible, }; // store object for next steps - localStorage.setItem(LS_KEY_FIGO_COSTCO, JSON.stringify(storedCostcoFigoData)); + localStorage.setItem(LS_KEY_COSTCO_FIGO, JSON.stringify(storedCostcoFigoData)); costcoFigoCouponData = storedCostcoFigoData; } } catch (status) { @@ -129,6 +126,6 @@ export async function checkCostcoFigoPromo(policyId, countryCode) { // remove storage data export async function resetCostcoFigoData() { if (hasCostcoFigoStored) { - localStorage.removeItem(LS_KEY_FIGO_COSTCO); + localStorage.removeItem(LS_KEY_COSTCO_FIGO); } } diff --git a/blocks/plans-quote/plans-quote.css b/blocks/plans-quote/plans-quote.css index b6821977..c6bbeffd 100644 --- a/blocks/plans-quote/plans-quote.css +++ b/blocks/plans-quote/plans-quote.css @@ -78,8 +78,10 @@ main .plans-quote form input:not(:placeholder-shown)~label { main .plans-quote form .wrapper.disabled-field > input { cursor: not-allowed; + cursor: unset; pointer-events: none; user-select: none; + -webkit-user-select: none; position: relative; } diff --git a/blocks/plans-quote/summary-quote.js b/blocks/plans-quote/summary-quote.js index 4d382e47..6022beee 100644 --- a/blocks/plans-quote/summary-quote.js +++ b/blocks/plans-quote/summary-quote.js @@ -16,7 +16,7 @@ import { import { isCanada } from '../../scripts/lib-franklin.js'; import { trackGTMEvent } from '../../scripts/lib-analytics.js'; import { getConfigValue } from '../../scripts/configs.js'; -import { getIsMultiPet } from './costco-promo.js'; +import { getIsMultiPet, isCostcoFigo } from './costco-promo.js'; export default async function decorateSummaryQuote(block, apiBaseUrl) { // initialize form based on results from the previous step @@ -266,8 +266,13 @@ export default async function decorateSummaryQuote(block, apiBaseUrl) { function getAutoRenewTet(itemId) { if (itemId === 'Annual Plan-DOGS' || itemId === 'Annual Plan-CATS') { + if (!isCostcoFigo) { + return jsx` + Your Annual Membership will automatically renew on your renewal date which is one year from today. The renewal rate is currently $19.95, plus applicable taxes (price is subject to change). + `; + } return jsx` - Your Annual Membership will automatically renew on your renewal date which is one year from today. The renewal rate is currently $19.95, plus applicable taxes (price is subject to change). + Your Annual Membership will automatically renew on your renewal date which is one year from today. The renewal rate is currently $0 (price is subject to change). `; } @@ -313,7 +318,7 @@ export default async function decorateSummaryQuote(block, apiBaseUrl) {