by DuroMax
Original price $999.00 - Original price $999.00
Original price $999.00
Translation missing: en.products.general.regular_price $1,399.00 Translation missing: en.products.general.sale_price $999.00
+ Free Shipping
$999.00 - $999.00
Current price Translation missing: en.products.general.regular_price $1,399.00 Translation missing: en.products.general.sale_price $999.00
+ Free Shipping
| /
Estimate Only, Carrier Delays May Occur
Shipping to
|
Change
Ship To
" ) $(".custom-zip-container").hide(); $(".custom-pipe").hide(); $(".custom-zip-change").html("Ship to my zip code") console.log("failure was run") } $.ajax({ type: 'GET', url: 'https://feeds.datafeedwatch.com/23194/403c16ad7bf9e691eed4c096045b404ac2e0a398.json?nocache=1', dataType: 'json', success: function (data) { console.log("Data Feed For: " + data.channel_info.url); var feedArray = data.products for (let i = 0; i < feedArray.length; i++) { if (feedArray[i].SKU == productSku) { skuMatch = true if (feedArray[i].inv_ca == 'true' && feedArray[i].inv_tn == 'true' ) { console.log("Available: Both") window.localStorage.setItem('availableLocation', 'both'); } else if (feedArray[i].inv_ca == 'true' || feedArray[i].inv_tn == 'true') { if (feedArray[i].inv_ca == 'true') { console.log("Available: CA Only") window.localStorage.setItem('availableLocation', 'CA'); } else if (feedArray[i].inv_tn == 'true') { console.log("Available: TN Only") window.localStorage.setItem('availableLocation', 'TN'); } } break } else { skuMatch = false } } if (!skuMatch) { skuFailure = true; console.log("SKU match failure.") failure(); return false; } } }).done(function() { momentHolidayInit(); momentRangeInit(); window['moment-range'].extendMoment(moment); window.localStorage.removeItem('ipFailure'); currentAvailable = window.localStorage.getItem('availableLocation'); bothObject = { AL : 2, AZ : 1, AR : 1, CA : 1, CO : 2, CT : 3, DE : 3, DC : 3, FL : 2, GA : 2, ID : 2, IL : 2, IN : 2, IA : 2, KS : 2, KY : 2, LA : 1, ME : 3, MD : 2, MA : 3, MI : 2, MN : 3, MS : 1, MO : 2, MT : 3, NE : 3, NV : 1, NH : 3, NJ : 2, NM : 3, NY : 3, NC : 2, ND : 3, OH : 2, OK : 2, OR : 2, PA : 2, RI : 3, SC : 2, SD : 3, TN : 2, TX : 2, UT : 2, VT : 3, VA : 2, WA : 3, WV : 2, WI : 2, WY : 3, } caObject = { AL : 4, AZ : 1, AR : 4, CA : 1, CO : 2, CT : 5, DE : 4, DC : 4, FL : 4, GA : 4, ID : 2, IL : 4, IN : 4, IA : 4, KS : 4, KY : 4, LA : 4, ME : 5, MD : 4, MA : 5, MI : 4, MN : 4, MS : 4, MO : 2, MT : 3, NE : 3, NV : 1, NH : 5, NJ : 4, NM : 3, NY : 5, NC : 4, ND : 3, OH : 4, OK : 4, OR : 2, PA : 2, RI : 4, SC : 4, SD : 3, TN : 4, TX : 4, UT : 2, VT : 5, VA : 4, WA : 3, WV : 4, WI : 4, WY : 3, } tnObject = { AL : 2, AZ : 3, AR : 1, CA : 4, CO : 3, CT : 3, DE : 3, DC : 3, FL : 2, GA : 2, ID : 4, IL : 2, IN : 2, IA : 2, KS : 2, KY : 2, LA : 1, ME : 3, MD : 3, MA : 3, MI : 2, MN : 3, MS : 1, MO : 2, MT : 4, NE : 3, NV : 4, NH : 3, NJ : 3, NM : 3, NY : 3, NC : 2, ND : 4, OH : 2, OK : 2, OR : 4, PA : 2, RI : 3, SC : 2, SD : 3, TN : 2, TX : 2, UT : 3, VT : 3, VA : 2, WA : 4, WV : 2, WI : 2, WY : 4, } function momentLocale() { moment.locale('en') } currentDate = new Date(); currentDay = currentDate.getDay(); currentMoment = moment(); currentHour = currentDate.getHours(); moment.modifyHolidays.set(['New Years Day', 'Christmas Day', 'Independence Day', 'Labor Day', 'Memorial Day', 'Thanksgiving']); todayHoliday = moment().isHoliday(); holidayList = moment().holidays(); holidayDate = 0; shipFinal = 0; shipTime = 0; shipFinalHoliday = false; shipFailure = false; foundMapProperty = true; passSunday = 0; geoCartHolding = {}; window.sessionStorage.removeItem('geoCartHolding'); function passSundayTest() { momentLocale() const range = moment.range(currentMoment, shipFinal); comingSunday = moment().day(0 + 7); passSunday = range.contains(comingSunday, { exclusive: true }); if (passSunday) { shipFinal = shipFinal.add(1, 'd'); console.log("Sunday passed! Day added!"); } else { console.log("No sunday passed"); } } function passSatTest() { momentLocale() const range = moment.range(currentMoment, shipFinal); comingSat = moment().day(0 + 6); console.log(comingSat) passSat = range.contains(comingSat, { exclusive: true }); if (passSat) { shipFinal = shipFinal.add(1, 'd'); console.log("Saturday passed! Day added!"); } else { console.log("No Saturday passed"); } } function passHolidayTest() { momentLocale() const range = moment.range(currentMoment, shipFinal); console.log(holidayList) for (const holiday in holidayList) { holidayDate = holidayList[holiday] passHoliday = range.contains(holidayDate, { exclusive: true }); if (passHoliday) { shipFinal = shipFinal.add(1, 'd'); console.log( holidayList[holiday]._d + " " + holiday + " passed! Day added!"); } } } function shipFinalSet() { momentLocale() shipFinal = moment().add(shipTime, 'd'); if ( currentDay == 5 && currentHour >= 14 ) { shipFinal = shipFinal.add(3, 'd'); shipFinalHoliday = shipFinal.isHoliday(); } else if (currentDay == 6) { shipFinal = shipFinal.add(2, 'd'); shipFinalHoliday = shipFinal.isHoliday(); } else if (currentDay == 0 || currentHour >= 14 || todayHoliday) { shipFinal = shipFinal.add(1, 'd'); console.log("sunday, after 2pm, or is holiday. Day added.") } } function shipTest() { momentLocale(); if (geoExtra == "true") { shipFinal = shipFinal.add(geoExtraDay, 'd'); console.log("Geo Extra Days Found - " + geoExtraDay + " days added.") } if (productTagLTL) { shipFinal = shipFinal.add(2, 'd'); passSatTest(); } passSundayTest(); passHolidayTest(); if (productTagLTL) { if (shipFinal.day() == 6) { console.log("Shipping on saturday: add 1 day") shipFinal = shipFinal.add(1, 'd'); } } if (shipFinal.day() == 0) { console.log("Shipping on sunday: add 1 day") shipFinal = shipFinal.add(1, 'd'); if (shipFinal.isHoliday()) { console.log("Arrival Day is a Holiday: add 1 day") shipFinal = shipFinal.add(1, 'd'); } } else if (shipFinal.isHoliday()) { console.log("Shipping on a Holiday: add 1 day") shipFinal = shipFinal.add(1, 'd'); if (shipFinal.day() == 0) { console.log("Arrival Day is a sunday: add 1 day") shipFinal = shipFinal.add(1, 'd'); } } shipFailure = false; $(".custom-zip-container").show(); $(".custom-pipe").show(); $(".custom-zip-change").html("Change"); $(".shipping-state-notice").html( "
" + "Order now, get it by " + "" + shipFinal.format("ddd, MMM D") + "" + "
" ) console.log("Base ship time is: " + shipTime + " days") console.log("Final ship date is: " + shipFinal.format("ddd, MMM D")) console.log("ship test was run") geoCartHolding["date"] = shipFinal.format("ddd, MMM D"); geoCartHolding["sku"] = productSku; window.sessionStorage.setItem('geoCartHolding', JSON.stringify(geoCartHolding)); if (skuFailure) { failure(); } } function failure() { shipFailure = true $(".shipping-state-notice").html( "
" + "Order Now - Ships Same Day." + "
" ) $(".custom-zip-container").hide(); $(".custom-pipe").hide(); $(".custom-zip-change").html("Ship to my zip code") console.log("failure was run") } function ipTest() { momentHolidayInit(); momentRangeInit(); window['moment-range'].extendMoment(moment); moment.modifyHolidays.set(['New Years Day', 'Christmas Day', 'Independence Day', 'Labor Day', 'Memorial Day', 'Thanksgiving']); ipInfo = JSON.parse(window.localStorage.getItem('imperialUserIP')); ipFailure = JSON.parse(window.localStorage.getItem('ipFailure')); submittedZip = window.localStorage.getItem('customZip'); submittedZipInfo = window.localStorage.getItem('customZipState'); $(".custom-zip-container").show(); $(".custom-pipe").show(); if (submittedZipInfo) { console.log("Submitted Zip Info: " + submittedZip +", " + submittedZipInfo); if (currentAvailable == "both") { console.log("Available Location: Both") for (const property in bothObject) { if (submittedZipInfo == property ) { shipTime = bothObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(submittedZip); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "CA") { console.log("Available Location: CA") for (const property in caObject) { if (submittedZipInfo == property ) { shipTime = caObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(submittedZip); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "TN") { console.log("Available Location: TN") for (const property in tnObject) { if (submittedZipInfo == property ) { shipTime = tnObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(submittedZip); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else { failure(); } } else if (ipInfo) { console.log("Cached Ip Info:") console.log(ipInfo); if (ipInfo.postal) { if (currentAvailable == "both") { console.log("Cached IP Logic: Both") for (const property in bothObject) { if (ipInfo.region_code == property ) { shipTime = bothObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(ipInfo.postal); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "CA") { console.log("Cached IP Logic: CA") for (const property in caObject) { if (ipInfo.region_code == property ) { shipTime = caObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(ipInfo.postal); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "TN") { console.log("Cached IP Logic: TN") for (const property in tnObject) { if (ipInfo.region_code == property ) { shipTime = tnObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(ipInfo.postal); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else { failure(); } } else if (ipInfo.region_code) { console.log("Zip not found, using state code: "+ ipInfo.region_code) if (currentAvailable == "both") { console.log("Cached IP Logic: Both") for (const property in bothObject) { if (ipInfo.region_code == property ) { shipTime = bothObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(ipInfo.region_code); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "CA") { console.log("Cached IP Logic: CA") for (const property in caObject) { if (ipInfo.region_code == property ) { shipTime = caObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(ipInfo.region_code); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "TN") { console.log("Cached IP Logic: TN") for (const property in tnObject) { if (ipInfo.region_code == property ) { shipTime = tnObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(ipInfo.region_code); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else { failure(); } } else { failure(); } } else { $.getJSON("https://ipapi.co/json/?key=0q5Uk0flqw01vI2GAsjzWtYe7Z4EHzFqIEVCDkDIYrP91lwlmi", function (response) { window.localStorage.setItem('imperialUserIP', JSON.stringify(response)); console.log("Fresh IP Info:") console.log(response); if (response.postal) { if (currentAvailable == "both") { console.log("Fresh IP Logic: Both") for (const property in bothObject) { if (response.region_code == property ) { shipTime = bothObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(response.postal); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "CA") { console.log("Fresh IP Logic: CA") for (const property in caObject) { if (response.region_code == property ) { shipTime = caObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(response.postal); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "TN") { console.log("Fresh IP Logic: TN") for (const property in tnObject) { if (response.region_code == property ) { shipTime = tnObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(response.postal); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else { failure(); } } else if (response.region_code) { console.log("Zip not found, using state code: "+ response.region_code) if (currentAvailable == "both") { console.log("Fresh IP Logic: Both") for (const property in bothObject) { if (response.region_code == property ) { shipTime = bothObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(response.region_code); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "CA") { console.log("Fresh IP Logic: CA") for (const property in caObject) { if (response.region_code == property ) { shipTime = caObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(response.region_code); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else if (currentAvailable == "TN") { console.log("Fresh IP Logic: TN") for (const property in tnObject) { if (response.region_code == property ) { shipTime = tnObject[property]; foundMapProperty = true; $(".custom-zip-desktop").html(response.region_code); shipFinalSet(); shipTest(); break } else { foundMapProperty = false; } } if (!foundMapProperty) { failure(); } } else { failure(); } } else { failure(); } }, "jsonp").fail(function(result) { failure(); console.log("Initial Ip Hit Failure") }); } }ipTest(); function getState(zipString) { const zipcode = parseInt(zipString, 10); let st; let state; /* Code cases alphabetized by state */ if (zipcode >= 35000 && zipcode <= 36999) { st = 'AL'; state = 'Alabama'; } else if (zipcode >= 85000 && zipcode <= 86999) { st = 'AZ'; state = 'Arizona'; } else if (zipcode >= 71600 && zipcode <= 72999) { st = 'AR'; state = 'Arkansas'; } else if (zipcode >= 90000 && zipcode <= 96699) { st = 'CA'; state = 'California'; } else if (zipcode >= 80000 && zipcode <= 81999) { st = 'CO'; state = 'Colorado'; } else if ((zipcode >= 6000 && zipcode <= 6389) || (zipcode >= 6391 && zipcode <= 6999)) { st = 'CT'; state = 'Connecticut'; } else if (zipcode >= 19700 && zipcode <= 19999) { st = 'DE'; state = 'Delaware'; } else if (zipcode >= 32000 && zipcode <= 34999) { st = 'FL'; state = 'Florida'; } else if ( (zipcode >= 30000 && zipcode <= 31999) || (zipcode >= 39800 && zipcode <= 39999) ) { st = 'GA'; state = 'Georgia'; } else if (zipcode >= 96700 && zipcode <= 96999) { st = 'HI'; state = 'Hawaii'; } else if (zipcode >= 83200 && zipcode <= 83999) { st = 'ID'; state = 'Idaho'; } else if (zipcode >= 60000 && zipcode <= 62999) { st = 'IL'; state = 'Illinois'; } else if (zipcode >= 46000 && zipcode <= 47999) { st = 'IN'; state = 'Indiana'; } else if (zipcode >= 50000 && zipcode <= 52999) { st = 'IA'; state = 'Iowa'; } else if (zipcode >= 66000 && zipcode <= 67999) { st = 'KS'; state = 'Kansas'; } else if (zipcode >= 40000 && zipcode <= 42999) { st = 'KY'; state = 'Kentucky'; } else if (zipcode >= 70000 && zipcode <= 71599) { st = 'LA'; state = 'Louisiana'; } else if (zipcode >= 3900 && zipcode <= 4999) { st = 'ME'; state = 'Maine'; } else if (zipcode >= 20600 && zipcode <= 21999) { st = 'MD'; state = 'Maryland'; } else if ( (zipcode >= 1000 && zipcode <= 2799) || (zipcode == 5501) || (zipcode == 5544 ) ) { st = 'MA'; state = 'Massachusetts'; } else if (zipcode >= 48000 && zipcode <= 49999) { st = 'MI'; state = 'Michigan'; } else if (zipcode >= 55000 && zipcode <= 56899) { st = 'MN'; state = 'Minnesota'; } else if (zipcode >= 38600 && zipcode <= 39999) { st = 'MS'; state = 'Mississippi'; } else if (zipcode >= 63000 && zipcode <= 65999) { st = 'MO'; state = 'Missouri'; } else if (zipcode >= 59000 && zipcode <= 59999) { st = 'MT'; state = 'Montana'; } else if (zipcode >= 27000 && zipcode <= 28999) { st = 'NC'; state = 'North Carolina'; } else if (zipcode >= 58000 && zipcode <= 58999) { st = 'ND'; state = 'North Dakota'; } else if (zipcode >= 68000 && zipcode <= 69999) { st = 'NE'; state = 'Nebraska'; } else if (zipcode >= 88900 && zipcode <= 89999) { st = 'NV'; state = 'Nevada'; } else if (zipcode >= 3000 && zipcode <= 3899) { st = 'NH'; state = 'New Hampshire'; } else if (zipcode >= 7000 && zipcode <= 8999) { st = 'NJ'; state = 'New Jersey'; } else if (zipcode >= 87000 && zipcode <= 88499) { st = 'NM'; state = 'New Mexico'; } else if ( (zipcode >= 10000 && zipcode <= 14999) || (zipcode == 6390) || (zipcode == 501) || (zipcode == 544) ) { st = 'NY'; state = 'New York'; } else if (zipcode >= 43000 && zipcode <= 45999) { st = 'OH'; state = 'Ohio'; } else if ((zipcode >= 73000 && zipcode <= 73199) || (zipcode >= 73400 && zipcode <= 74999) ) { st = 'OK'; state = 'Oklahoma'; } else if (zipcode >= 97000 && zipcode <= 97999) { st = 'OR'; state = 'Oregon'; } else if (zipcode >= 15000 && zipcode <= 19699) { st = 'PA'; state = 'Pennsylvania'; } else if (zipcode >= 300 && zipcode <= 999) { st = 'PR'; state = 'Puerto Rico'; } else if (zipcode >= 2800 && zipcode <= 2999) { st = 'RI'; state = 'Rhode Island'; } else if (zipcode >= 29000 && zipcode <= 29999) { st = 'SC'; state = 'South Carolina'; } else if (zipcode >= 57000 && zipcode <= 57999) { st = 'SD'; state = 'South Dakota'; } else if (zipcode >= 37000 && zipcode <= 38599) { st = 'TN'; state = 'Tennessee'; } else if ( (zipcode >= 75000 && zipcode <= 79999) || (zipcode >= 73301 && zipcode <= 73399) || (zipcode >= 88500 && zipcode <= 88599) ) { st = 'TX'; state = 'Texas'; } else if (zipcode >= 84000 && zipcode <= 84999) { st = 'UT'; state = 'Utah'; } else if (zipcode >= 5000 && zipcode <= 5999) { st = 'VT'; state = 'Vermont'; } else if ( (zipcode >= 20100 && zipcode <= 20199) || (zipcode >= 22000 && zipcode <= 24699) || (zipcode == 20598) ) { st = 'VA'; state = 'Virgina'; } else if ( (zipcode >= 20000 && zipcode <= 20099) || (zipcode >= 20200 && zipcode <= 20599) || (zipcode >= 56900 && zipcode <= 56999) ) { st = 'DC'; state = 'Washington DC'; } else if (zipcode >= 98000 && zipcode <= 99499) { st = 'WA'; state = 'Washington'; } else if (zipcode >= 24700 && zipcode <= 26999) { st = 'WV'; state = 'West Virginia'; } else if (zipcode >= 53000 && zipcode <= 54999) { st = 'WI'; state = 'Wisconsin'; } else if (zipcode >= 82000 && zipcode <= 83199) { st = 'WY'; state = 'Wyoming'; } else { st = 'none'; state = 'none'; console.log('No state found matching', zipcode); failure(); } return st; } $(".custom-zip-submit-mobile").on("click", function() { submitZip = $('#zipcode').val(); if (typeof submitZip !== 'string' || submitZip.length < 3 || submitZip.length > 5) { alert("Entered Zipcode must be at least 3 - 5 digits.") } else if (submitZip == submittedZip) { console.log("Same zipcode submitted."); $(".custom-zip-desktop-tooltip").removeClass("visible-appear"); $(".custom-zip-mobile").removeClass("flex") $(".custom-zip-change").html("Change"); } else { shipFailure = false; $(".custom-zip-desktop-tooltip").removeClass("visible-appear"); $(".custom-zip-mobile").removeClass("flex") $(".custom-zip-change").html("Change"); window.localStorage.removeItem('customZip'); window.localStorage.removeItem('customZipState'); submittedZipState = getState(submitZip); window.localStorage.setItem('customZip', submitZip); window.localStorage.setItem('customZipState', submittedZipState); window.sessionStorage.removeItem('geoCartHolding'); window.sessionStorage.removeItem('geoCartArray'); geoCartHolding = {}; ipTest(); //Send out custom zipcode update event document.dispatchEvent(new Event('geolocation-pdp:update')); } }); $(".custom-zip-submit-desktop").on("click", function() { submitZip = $('#zipcode-desktop').val(); if (typeof submitZip !== 'string' || submitZip.length < 3 || submitZip.length > 5) { alert("Entered Zipcode must be at least 3 - 5 digits.") } else if (submitZip == submittedZip) { console.log("Same zipcode submitted."); $(".custom-zip-desktop-tooltip").removeClass("visible-appear"); $(".custom-zip-mobile").removeClass("flex") $(".custom-zip-change").html("Change"); } else { shipFailure = false; $(".custom-zip-desktop-tooltip").removeClass("visible-appear"); $(".custom-zip-mobile").removeClass("flex") $(".custom-zip-change").html("Change"); window.localStorage.removeItem('customZip'); window.localStorage.removeItem('customZipState'); submittedZipState = getState(submitZip); window.localStorage.setItem('customZip', submitZip); window.localStorage.setItem('customZipState', submittedZipState); window.sessionStorage.removeItem('geoCartHolding'); window.sessionStorage.removeItem('geoCartArray'); geoCartHolding = {}; ipTest(); //Send out custom zipcode update event document.dispatchEvent(new Event('geolocation-pdp:update')); } }); $(".custom-zip-change").on("click", function() { currentZipChangeValue = $(".custom-zip-change").text() $("#zipcode-desktop").val("") $("#zipcode").val("") $(".custom-zip-desktop-tooltip").toggleClass("visible-appear") $(".custom-zip-mobile").toggleClass("flex") if ( currentZipChangeValue == "Ship to my zip code") { shipFailure = true $(".custom-zip-change").html("Cancel") } else if ( shipFailure ) { $(".custom-zip-change").html("Ship to my zip code") } else if ( currentZipChangeValue == "Change") { $(".custom-zip-change").html("Cancel") } else { $(".custom-zip-change").html("Change") } }) $(".fa-times-circle").on("click", function() { $(".custom-zip-desktop-tooltip").removeClass("visible-appear") if ( shipFailure ) { $(".custom-zip-change").html("Ship to my zip code") } else { $(".custom-zip-change").html("Change") } }) $(document).on('click', function (e) { if ($(e.target).closest(".close-function").length === 0) { $(".custom-zip-desktop-tooltip").removeClass("visible-appear"); $(".custom-zip-mobile").removeClass("flex"); if ( shipFailure ) { $(".custom-zip-change").html("Ship to my zip code") } else { $(".custom-zip-change").html("Change") } } }); function handle_zipcode_update(){ let new_zip = window.localStorage.getItem('customZip'); if (new_zip){ ipTest() } } //Listen for zipcode updates from product details and handle accordingly document.addEventListener('geolocation-header:update', handle_zipcode_update); }).fail(function() { console.log("Data Feed Failure") failure(); })});