One or more of the items in your cart is a recurring or deferred purchase. By continuing, I agree to the cancellation policy and authorize you to charge my payment method at the prices, frequency and dates listed on this page until my order is fulfilled or I cancel, if permitted.
Save 10% On All Subscription Orders
Cart
Item added to your cart
View cart
Customer Care In Every Pair
Clear vision, clear service since 1995.
Why Choose Fresh Lens?
Top Selling Products
Because when it comes to eyes, people trust us.
-
Vistakon Acuvue Oasys 6 Pack
Sale
Vistakon Acuvue Oasys 6 Pack
5.0 / 5.0
(30) 30 total reviews
Regular price $45.99 USD
Regular price
$53.99 USDSale price $45.99 USD $45.99 USDUnit price / per
Sale
Add To Cart -
Acuvue 2 - 6pk
Sale
Acuvue 2 - 6pk
5.0 / 5.0
(35) 35 total reviews
Regular price $42.99 USD
$38.69 USD
Regular price
$52.99 USDSale price $42.99 USD $38.69 USDUnit price / per
Sale
Add To Cart -
Acuvue Oasys - 12 Pack
Sale
Acuvue Oasys - 12 Pack
5.0 / 5.0
(23) 23 total reviews
Regular price $88.99 USD
$80.09 USD
Regular price
$98.99 USDSale price $88.99 USD $80.09 USDUnit price / per
Sale
Add To Cart -
Acuvue Oasys for Astigmatism 6pk
Sale
Acuvue Oasys for Astigmatism 6pk
4.98 / 5.0
(40) 40 total reviews
Regular price $50.99 USD
$45.89 USD
Regular price
$60.99 USDSale price $50.99 USD $45.89 USDUnit price / per
Sale
Add To Cart -
Biofinity 6pk
Sale
Biofinity 6pk
4.96 / 5.0
(24) 24 total reviews
Regular price $69.99 USD
$62.99 USD
Regular price
$79.99 USDSale price $69.99 USD $62.99 USDUnit price / per
Sale
Add To Cart -
ACUVUE 1 Day Moist 90pk
Sale
ACUVUE 1 Day Moist 90pk
4.98 / 5.0
(46) 46 total reviews
Regular price $73.99 USD
$66.59 USD
Regular price
$83.99 USDSale price $73.99 USD $66.59 USDUnit price / per
Sale
Add To Cart -
Acuvue Oasys - 24 Pack
Sale
Acuvue Oasys - 24 Pack
4.95 / 5.0
(37) 37 total reviews
Regular price $132.99 USD
$119.69 USD
Regular price
$142.99 USDSale price $132.99 USD $119.69 USDUnit price / per
Sale
Add To Cart -
Bausch and Lomb ULTRA 6pk
Sale
Bausch and Lomb ULTRA 6pk
5.0 / 5.0
(8) 8 total reviews
Regular price $59.99 USD
Regular price
$69.99 USDSale price $59.99 USD $59.99 USDUnit price / per
Sale
Add To Cart
Don’t spend extra on contact lenses a year
Check Out Our Reviews!
Because when it comes to eyes, people trust us.
I received my contact lens as scheduled. Everything was to my satisfaction. I also received complimentary contact lens cases!
Iman Ali
Fast delivered to the USA, I am very satisfied with this company. It is good that they deliver even to the USA
Moka
I've been a loyal customer of Fresh Lens for years. It's a fantastic company to deal with. Ordering is quick and hassle-free.
John B.
I have been buying my contacts here for many years it's always quick and easy and I've never had any problems Any Questions I had were answered quickly
Samantha Segan
Frequently Asked Questions
How do I order contact lenses?
Ordering contact lenses through Fresh Lens is a simple process:
Browse and Choose: Explore our extensive collection of contact lenses to find the perfect fit for your needs. Whether you're looking for daily, weekly, or monthly lenses, we have a wide range of options to suit your lifestyle.
Enter Your Prescription: Have your prescription details ready? Great! Enter the necessary information during the ordering process. This ensures that you receive lenses tailored to your specific vision requirements.
Add to Cart: Once you've input your prescription, add the selected contact lenses to your cart. Take your time to review your choices and ensure they align with your preferences and prescription needs.
Checkout with Ease: Ready to proceed? Head to the checkout, where you'll provide your shipping details. Our user-friendly interface makes it a breeze to complete your purchase securely. Simply follow the prompts and finalize your order by making a seamless payment.
Remember, it’s important to have a current prescription from your optometrist when ordering contact lenses. Stay safe and take care of your eyes! 👀
How fast will I get my contact lenses?
We understand how important it is to receive your contact lenses quickly and efficiently. At Fresh Lens, we offer several shipping options to ensure your order arrives as promptly as possible.
For Canadian Orders:
- Your contact lenses will be shipped via Xpresspost and typically take 3-5 business days to arrive from the date of your order. You'll receive a tracking number once your order ships, so you can follow its journey to your doorstep.
For US Orders:
- We provide three convenient shipping methods to cater to your needs:
- USPS Tracked Packet: Your lenses will arrive in 3-5 business days.
- Xpresspost USA: A faster option, with delivery in 2-3 business days.
- Next Day USA: For the quickest delivery, your lenses will arrive in 1-2 business days.
Regardless of the method you choose, we’ll email you a tracking number once your order ships. Please note that while these are average shipping times, actual delivery may vary slightly. If your prescription is not in stock, it may take an additional 2 business days to order from the manufacturer.
Choose Fresh Lens for reliable and swift delivery of your contact lenses!
How can I renew my expired prescription?
Renewing your expired prescription with Fresh Lens is quick and easy! We offer a free online tool that allows you to update your prescription in just 6 minutes (available for orders over $200).
Here’s how it works:
- Take the Test Online: All you need is your phone, computer, and 10 feet of space. The test takes about 6 minutes to complete.
- Doctor Reviews Your Results: A licensed optometrist or ophthalmologist in your region will review and approve your results.
- Use Your Results: Access your updated prescription anytime through our online portal.
Benefits:
- Convenient: Complete the test from the comfort of your home.
- Accessible: Access your prescription anywhere, anytime.
Doctor Approved: All prescriptions are issued by licensed eye care professionals.
Renew My Rx Online
We’re here to help.
Real people with real answers in real time, 24/7.
+1 888-699-1963
Subscribe to our Newsletter
Fresh lens
- About
- Blog
- Free Online Vision Exam
- Rx Requirements
- Reviews
Collections
- Daily
- Weekly
- Monthly
- Color
- Solutions
Policies
- Privacy Policy
- Shipping
- Refund and Return
- Terms Of Service
- Billing
© 2024 Fresh Lens | CanadianContactLenses.com.


{{^requires_selling_plan}}{{^showSubOptionBeforeOneTime}}
{{/showSubOptionBeforeOneTime}}{{/requires_selling_plan}} {{#sellingPlanVariants}}
{{^prepaidFlag}} {{#showFormattedDiscountText}} {{formattedDiscountText}}{{/showFormattedDiscountText}}
{{{frequencyDescription}}}
{{/prepaidFlag}}{{#prepaidFlag}}{{#showFormattedDiscountText}} {{formattedDiscountText}}{{/showFormattedDiscountText}}
{{{frequencyDescription}}}
{{/prepaidFlag}}
{{/sellingPlanVariants}}{{^requires_selling_plan}}{{#showSubOptionBeforeOneTime}}
{{/showSubOptionBeforeOneTime}}{{/requires_selling_plan}}
{{#showStaticTooltip}}
{{{toolTipDescription}}}
{{/showStaticTooltip}}{{#showTooltip}}
{{{tooltipTitle}}}
{{{toolTipDescription}}}
{{companyName}}
{{/showTooltip}}
\\n
\\n
{{{purchaseOptionsText}}}
\\n
\\n{{^requires_selling_plan}}\\n{{^showSubOptionBeforeOneTime}}\\n
\\n \\n \\n \\n
\\n{{/showSubOptionBeforeOneTime}}\\n{{/requires_selling_plan}}\\n {{#sellingPlanVariants}}\\n
\\n \\n \\n{{^prepaidFlag}}\\n \\n{{#showFormattedDiscountText}}\\n {{{formattedDiscountText}}}\\n{{/showFormattedDiscountText}}\\n
{{{frequencyDescription}}}
\\n{{/prepaidFlag}}\\n{{#prepaidFlag}}\\n\\n{{#showFormattedDiscountText}}\\n {{{formattedDiscountText}}}\\n{{/showFormattedDiscountText}}\\n
{{{frequencyDescription}}}
\\n\\n{{/prepaidFlag}}\\n \\n
\\n {{/sellingPlanVariants}}\\n{{^requires_selling_plan}}\\n{{#showSubOptionBeforeOneTime}}\\n
\\n \\n \\n \\n
\\n{{/showSubOptionBeforeOneTime}}\\n{{/requires_selling_plan}}\\n
\\n{{#showStaticTooltip}}\\n
{{{toolTipDescription}}}
\\n{{/showStaticTooltip}}\\n{{#showTooltip}}\\n\\n
\\n
\\n {{{tooltipTitle}}}\\n
\\n
\\n
\\n {{{toolTipDescription}}}\\n
\\n {{#showAppstleLink}}\\n
\\n \\n POWERED BY APPSTLE \\n
\\n {{/showAppstleLink}}\\n
\\n{{/showTooltip}}\\n
\\n
\\n
\\n{% endraw %}\",\"WIDGET_TYPE_7\":\"{% raw %}{% endraw %}\",\"WIDGET_TYPE_2\":\"{% raw %}{% endraw %}\",\"WIDGET_TYPE_3\":\"{% raw %}
\\n
\\n
{{{purchaseOptionsText}}}
\\n
\\n{{#showSubOptionBeforeOneTime}}\\n {{#sellingPlanVariants}}\\n
\\n \\n {{^prepaidFlag}}\\n \\n {{/prepaidFlag}}\\n {{#prepaidFlag}}\\n \\n {{/prepaidFlag}}\\n \\n
\\n {{/sellingPlanVariants}}\\n{{/showSubOptionBeforeOneTime}}\\n {{^requires_selling_plan}}\\n
\\n \\n \\n \\n
\\n {{/requires_selling_plan}}\\n{{^showSubOptionBeforeOneTime}}\\n {{#sellingPlanVariants}}\\n
\\n \\n {{^prepaidFlag}}\\n \\n {{/prepaidFlag}}\\n {{#prepaidFlag}}\\n \\n {{/prepaidFlag}}\\n \\n
\\n {{/sellingPlanVariants}}\\n{{/showSubOptionBeforeOneTime}}\\n
\\n{{#showStaticTooltip}}\\n
{{{toolTipDescription}}}
\\n{{/showStaticTooltip}}\\n{{#showTooltip}}\\n
\\n
\\n {{{tooltipTitle}}}\\n
\\n
\\n
\\n {{{toolTipDescription}}}\\n
\\n {{#showAppstleLink}}\\n
\\n \\n POWERED BY APPSTLE\\n \\n
\\n{{/showAppstleLink}}\\n
\\n{{/showTooltip}}\\n
\\n
{% endraw %}\",\"WIDGET_TYPE_4\":\"{% raw %}
\\n
\\n
{{{purchaseOptionsText}}}
\\n
\\n{{^requires_selling_plan}}\\n{{^showSubOptionBeforeOneTime}}\\n
\\n \\n \\n
\\n{{/showSubOptionBeforeOneTime}}\\n{{/requires_selling_plan}}\\n {{#sellingPlanVariants}}\\n
\\n {{{formattedDiscountText}}}\\n \\n{{^prepaidFlag}}\\n \\n{{/prepaidFlag}}\\n{{#prepaidFlag}}\\n\\n{{/prepaidFlag}}\\n
\\n {{/sellingPlanVariants}}\\n{{^requires_selling_plan}}\\n{{#showSubOptionBeforeOneTime}}\\n
\\n \\n \\n
\\n{{/showSubOptionBeforeOneTime}}\\n{{/requires_selling_plan}}\\n
\\n{{#showStaticTooltip}}\\n
{{{toolTipDescription}}}
\\n{{/showStaticTooltip}}\\n{{#showTooltip}}\\n
\\n
\\n {{{tooltipTitle}}}\\n
\\n
\\n
\\n {{{toolTipDescription}}}\\n
\\n{{#showAppstleLink}}\\n
\\n \\n POWERED BY APPSTLE\\n \\n
\\n{{/showAppstleLink}}\\n
\\n{{/showTooltip}}\\n
\\n
{% endraw %}\",\"WIDGET_TYPE_5\":\"{% raw %}
\\n
\\n
{{{purchaseOptionsText}}}
\\n
\\n{{^showSubOptionBeforeOneTime}}\\n{{^requires_selling_plan}}\\n
\\n \\n \\n \\n
\\n{{/requires_selling_plan}}\\n{{/showSubOptionBeforeOneTime}}\\n {{#sellingPlanVariants}}\\n
\\n \\n \\n \\n
\\n {{/sellingPlanVariants}}\\n{{#showSubOptionBeforeOneTime}}\\n{{^requires_selling_plan}}\\n
\\n \\n \\n \\n
\\n{{/requires_selling_plan}}\\n{{/showSubOptionBeforeOneTime}}\\n
\\n{{#showStaticTooltip}}\\n
{{{toolTipDescription}}}
\\n{{/showStaticTooltip}}\\n{{#showTooltip}}\\n
\\n
\\n {{{tooltipTitle}}}\\n
\\n
\\n
\\n {{{toolTipDescription}}}\\n
\\n {{#showAppstleLink}}\\n
\\n \\n POWERED BY APPSTLE\\n \\n
\\n {{/showAppstleLink}}\\n
\\n{{/showTooltip}}\\n
\\n
{% endraw %}\"}", "bundle": {}, "labels": `{\"appstle.subscription.wg.noSubscriptionLabelTextV2\":\"No Subscription\",\"appstle.subscription.wg.cancelAnytimeLabelTextV2\":\"\",\"appstle.subscription.wg.addToShipmentErrorTextV2\":\"Error\",\"appstle.subscription.wg.weeksFrequencyTextV2\":\"Weeks\",\"appstle.subscription.wg.weeklyLabelTextV2\":\"Weekly\",\"appstle.subscription.wg.displayAddToExistingSubscriptionButtonForNotLoggedInV2\":\"false\",\"appstle.subscription.wg.addToShipmentProcessingV2\":\"Processing...\",\"appstle.subscription.wg.deliveryEveryFrequencyTextV2\":\"Delivery Every\",\"appstle.subscription.wg.subscribeAndSaveInitalV2\":\"Subscribe & save\",\"appstle.subscription.wg.allowRefreshOnCartPageV2\":\"false\",\"appstle.subscription.wg.prepaidLabelTextV2\":\"Prepaid\",\"appstle.subscription.wg.daysFrequencyTextV2\":\"Days\",\"appstle.subscription.wg.monthlyLabelTextV2\":\"Save 10% on every order\",\"appstle.subscription.wg.subscribeAndSaveSuccessV2\":\"Subscribe success\",\"appstle.subscription.wg.addToShipmentSuccessTextV2\":\"Success\",\"appstle.subscription.wg.monthFrequencyTextV2\":\"Month\",\"appstle.subscription.wg.addToShipmentButtonTextV2\":\"Add to Shipment\",\"appstle.subscription.wg.displayAddToExistingSubscriptionButtonToSubscribersOnlyV2\":\"false\",\"appstle.subscription.wg.yearsFrequencyTextV2\":\"Years\",\"appstle.subscription.wg.onetimeDescriptionTextV2\":\"\",\"appstle.subscription.wg.addToShipmentTooltipTextV2\":\"Please avoid double delivery charges! Login to add this product to an upcoming delivery.\",\"appstle.subscription.wg.weekFrequencyTextV2\":\"Week\",\"appstle.subscription.wg.oneTimePurchaseTextV2\":\"One Time Purchase\",\"appstle.subscription.wg.loyaltyPerkDescriptionTextV2\":\"{{#isDiscountTypeFreeProduct}}
<\/img><\/div>
After {{{billingCycleBlock}}} orders, get a FREE {{freeProductName}} <\/span><\/div> {{\/isDiscountTypeFreeProduct}}{{#isDiscountTypePercentage}}After {{{billingCycleBlock}}}<\/span> order<\/span>, get {{{discount}}}% OFF your entire order<\/span><\/span>.{{\/isDiscountTypePercentage}}{{#isDiscountTypeShipping}}After {{{billingCycleBlock}}}<\/span> order<\/span>, get shipping at {{{formatDiscountedPrice}}}<\/span><\/span>.{{\/isDiscountTypeShipping}}{{#isDiscountTypeFixed}}After {{{billingCycleBlock}}}<\/span> order<\/span>, get {{{formatDiscountedPrice}}} OFF your entire order<\/span><\/span>.{{\/isDiscountTypeFixed}}\",\"appstle.subscription.wg.unsubscribeFrequencyTextV2\":\"unsubscribe\",\"appstle.subscription.wg.oneTimeFrequencyTextV2\":\"\",\"appstle.subscription.wg.dayFrequencyTextV2\":\"day\",\"appstle.subscription.wg.allowFulfilmentCountViaPropertiesV2\":\"false\",\"appstle.subscription.wg.monthsFrequencyTextV2\":\"Months\",\"appstle.subscription.wg.manageSubscriptionButtonTextV2\":\"Manage Subscription\",\"appstle.subscription.wg.offFrequencyTextV2\":\"Off\",\"appstle.subscription.wg.yearFrequencyTextV2\":\"Year\",\"appstle.subscription.wg.prepayLabelTextV2\":\"Prepay\",\"appstle.subscription.wg.sellingPlanTitleTextNonPrepaid\":\"{{sellingPlanName}}\",\"appstle.subscription.wg.selectDeliverOptionV2\":\"select deliver option\",\"appstle.subscription.wg.yearlyLabelTextV2\":\"Yearly\"}`, "css": { "appstle_subscription_widget": { "margin-top": "" , "margin-bottom": "", }, "appstle_subscription_wrapper": { "border-width": "", "border-color": "", }, "appstle_circle": { "border-color": "", }, "appstle_dot": { "background-color": "", }, "appstle_select": { "padding-top": "", "padding-bottom": "", "padding-left": "", "padding-right": "", "border-width": "", "border-style": "", "border-color": "", "border-radius": "", }, "tooltip_subscription_svg": { "fill": "", }, "appstle_tooltip": { "color": "", "background-color": "", }, "appstle_tooltip_border_top_color": { "border-top-color": "", }, "appstle_subscription_final_price": { "color": "", }, "appstle_widget_text_color": { "color": "", }, "appstle_selected_background": { "background": "transparent", }, "elementCSS": "[\".appstle_tooltip_content {background-color: #ffffff !important;} #appstle_subscription_widget0 [data-appstle-icon]:after {border-top-color: #ffffff !important;}\"]", "customCSS": ".widgetSellingPlanWrapper input:checked+label span {\ncolor: #A1D461!important;\n}", "customerPortalCss": "", "externalStyleTag": "", "themeCss": "", } }; window.AppstleSubscription = window.AppstleSubscription || JSON.parse(JSON.stringify(RS)); sessionStorage['appstleSubscriptionConfig'] = JSON.stringify(RS.Config); var _RSConfig = _RSConfig || {}; _RSConfig.shop = 'fresh-lens.myshopify.com'; _RSConfig.shopMoneyFormat = '<span class='money conversion-bear-money'>${{amount}} </span>'; _RSConfig.shopMoneyFormatWithCurrencyFormat = '<span class='money conversion-bear-money'>${{amount}} USD</span>'; } ${msg}
' + '
' + '
' + '' + 'body' + '>' + ''; function toggleWidget() { loadAppstleLoyaltyWidget(); if (_ALConfig?.widget_setting?.widgetType?.toUpperCase() === 'LAUNCHER' && _ALConfig?.widget_setting?.forceRedirectDedicatedPage === true) { window.open(`/${_ALConfig?.proxy_path_prefix}`); } else { document.querySelector('#appstle_loyalty_iframe')?.classList?.toggle('open'); showAppstleLoyaltyWidget(); setTimeout(function() { document.querySelector('#appstle_loyalty_iframe')?.classList?.toggle('show-close-icon'); }, 900); } } const loadAppstleLoyaltyWidget = () => { var iframe = document.querySelectorAll('#appstle_loyalty_iframe'); iframe.forEach(function(item) { item.contentWindow._ALConfig = _ALConfig; item.contentWindow.document.open('text/html', 'replace'); item.contentWindow.document.write(alIframeSrc); item.contentWindow.document.close(); }); }; if (_ALConfig?.customerLoyalty && _ALConfig?.customerLoyalty?.availablePoints) { document.querySelector('#appstle-loyalty-button')?.classList?.add('appstle_show_points'); document.querySelector('.loyalty_widget_available_points').innerHTML = _ALConfig?.customerLoyalty?.availablePoints?.toLocaleString(); } if (_ALConfig?.widget_setting?.showTierName && _ALConfig?.customerLoyalty && _ALConfig?.customerLoyalty?.currentVipTier) { document.querySelector('.loyalty_widget_available_points').innerHTML = _ALConfig?.customerLoyalty?.currentVipTier?.toLocaleString(); } if (_ALConfig?.widget_setting?.showWidget) { if (location?.hash?.indexOf('#appstle-loyalty') !== -1 || location?.hash?.indexOf('#appstle-loyalty-earn-rewards') !== -1 || location?.hash?.indexOf('#appstle-loyalty-redeem-rewards') !== -1 || location?.hash?.indexOf('#appstle-loyalty-referrals') !== -1 || location?.hash?.indexOf('#appstle-loyalty-vip-program') !== -1) { handleDeepLink(); } } if (window?.location?.hash?.indexOf('#appstle-refer') !== -1) { handleDeepLink(); } function handleDeepLink() { loadAppstleLoyaltyWidget(); document.querySelector('#appstle_loyalty_iframe')?.classList?.toggle('open'); showAppstleLoyaltyWidget(); setTimeout(function() { document.querySelector('#appstle_loyalty_iframe')?.classList?.toggle('show-close-icon'); }, 900); } const widgetReferralUrl = new URL(window.location.href); if (widgetReferralUrl?.searchParams.get('appstle_referral') && _ALConfig?.widget_setting?.widgetType === 'LAUNCHER') { let redirectURL = _ALConfig?.widget_setting?.referralRedirectUrl + window.location.search; if (redirectURL && !window.location.pathname.includes(_ALConfig.widget_setting.referralRedirectUrl)) { window.open(redirectURL, '_self'); } setTimeout(() => { loadAppstleLoyaltyWidget(); enableWidget(); }, 200); } const alDOMObserver = new MutationObserver(function(mutations_list) { mutations_list.forEach(function(mutation) { mutation.addedNodes.forEach(function(added_node) { if (added_node.id == 'appstle_loyalty_iframe') { var iframe = document.querySelectorAll('#appstle_loyalty_iframe'); iframe.forEach(function(item) { item.contentWindow._ALConfig = _ALConfig; item.contentWindow.document.open('text/html', 'replace'); item.contentWindow.document.write(alIframeSrc); item.contentWindow.document.close(); }); alDOMObserver.disconnect(); } }); }); }); alDOMObserver.observe(document.querySelector('body'), { subtree: true, childList: true });
const dedicatedPageURL = new URL(window.location.href); if (dedicatedPageURL?.searchParams?.get('appstle_referral') && _ALConfig?.widget_setting?.widgetType === 'DEDICATED_PAGE' && !window.location.href.includes(_ALConfig?.proxy_path_prefix)) { window.open(`/${_ALConfig?.proxy_path_prefix}${window.location.search}`, '_self'); } const dedicatedPageEventListener = (event) => { if (event?.data && typeof event?.data.indexOf === 'function' && event?.data?.indexOf('refresh_appstle_loyalty_page') !== -1) { initiateAppstleLoyaltyPage() console.log("REFRESH PAGE"); } } window.addEventListener('message', dedicatedPageEventListener, false); function initiateAppstleLoyaltyPage() { if (document.querySelector('#appstleLoyaltyPage')) { const appstleLoyaltyPageElement = document.getElementById('appstleLoyaltyPage'); while (appstleLoyaltyPageElement.firstChild) { appstleLoyaltyPageElement.firstChild.remove(); } var s = document.createElement('script'); s.setAttribute('src', "https://cdn.shopify.com/s/files/1/0973/5648/t/32/assets/appstle_loyalty.js?v=1693554602"); s.setAttribute('defer', 'defer'); document.body.appendChild(s); var head = document.head; var link = document.createElement('link'); link.type = 'text/css'; link.rel = 'stylesheet'; link.href = "https://cdn.shopify.com/s/files/1/0973/5648/t/32/assets/appstle_loyalty.css?v=1693554603"; head.appendChild(link); } else { setTimeout(() => { initiateAppstleLoyaltyPage(); }, 2000); } } const dedicatedPageReferralUrl = new URL(window.location.href)?.searchParams.get('appstle_referral'); const checkDedicatedPageForRestrictions = () => { const { widget_setting, customerTags, customerLoyalty, customerId } = _ALConfig || {}; const { allowedCustomersTag, restrictedCustomersTag } = widget_setting || {}; const { customerStatus } = customerLoyalty || {}; if (customerStatus === 'EXCLUDED') { return false; } if (!dedicatedPageReferralUrl && !customerId) { return !(allowedCustomersTag || restrictedCustomersTag); } if (allowedCustomersTag?.length) { const allowedTags = allowedCustomersTag.split(','); if (!allowedTags.some(tag => customerTags?.some((customerTag) => customerTag?.trim()?.toLowerCase() === tag?.trim()?.toLowerCase()))) { return false; } } if (restrictedCustomersTag?.length) { const restrictedTags = restrictedCustomersTag.split(','); if (restrictedTags.some(tag => customerTags?.some((customerTag) => customerTag?.trim()?.toLowerCase() === tag?.trim()?.toLowerCase()))) { return false; } } return true; }; if (_ALConfig?.widget_setting?.showWidget === true && checkDedicatedPageForRestrictions()) { initiateAppstleLoyaltyPage(); }
(async function() { const isAvailableVisitShop = _ALConfig?.pointEarnRules?.length > 0 && _ALConfig?.pointEarnRules?.find((rule) => rule?.type === 'VISIT_SHOP' && rule?.status === 'ACTIVE'); if (_ALConfig?.customerId && isAvailableVisitShop) { if (!sessionStorage.getItem('syncVisitStore') && ((_ALConfig?.customerId && isAvailableVisitShop && isAvailableVisitShop?.id) || (_ALConfig?.referralEnabled && _ALConfig?.referralLoyalty?.referralType === 'VISIT_SHOP'))) { try { const response = await fetch(`/${_ALConfig?.proxy_path_prefix || 'apps/loyalty'}/cp/api/customer-visit-store`, { method: 'POST', headers: {'Content-Type': 'application/json'}, }); if (response?.ok) { sessionStorage.setItem('syncVisitStore', 'true'); } } catch (error) { console.error('Error:', error); } } } })();
const loyaltyCustomStyles = `
`; document.querySelector('body').insertAdjacentHTML('beforeend', loyaltyCustomStyles);