\\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 {{{toolTipDescription}}}\\n
\\n
\\n \\n {{companyName}}\\n \\n
\\n
\\n
\\n{{/showTooltip}}\\n
\\n
{% endraw %}\"}", "bundle": {"perDelivery":"/Delivery","showDiscountInCart":"false","discountPopupBuy":"Buy Now","showDiscountPopup":true,"discountPopupAmount":"","showOnProductPage":"true","showMultipleOnProductPage":"false","oneTimeDiscount":"false","variant":"Variant","selector":"","showProductPrice":"true","customCss":"","actionButtonFontColor":"","redirectTo":"CART","productTitleColor":"","discountPopupCheckoutMessage":"Apply Discount and go to checkout ?","discountPopupNo":"No","elementCSS":"[]","actionButtonColor":"","deliveryFrequency":"Delivery Frequency","forceReloadWidgetSelector":"","productPriceColor":"","bundleRules":"[{\"id\":2145,\"shop\":\"sol-cleanse-3052.myshopify.com\",\"name\":\"APPSTL TEST CC\",\"title\":\"Test Custom Cleanse\",\"description\":\"Create a cleanse Tailored to you\",\"priceSummary\":null,\"actionButtonText\":\"Checkout\",\"actionButtonDescription\":null,\"status\":\"ACTIVE\",\"showBundleWidget\":false,\"customerIncludeTags\":null,\"startDate\":null,\"endDate\":null,\"discountType\":\"PERCENTAGE\",\"discountValue\":0.0,\"bundleLevel\":\"PRODUCT\",\"products\":\"[{\\\"id\\\":8700592488758,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Awaken\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Awaken-Smoothie.png?v=1699328961\\\",\\\"productHandle\\\":\\\"awaken\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700784378166,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Balance\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Balance-400m.png?v=1699328917\\\",\\\"productHandle\\\":\\\"balance\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700596945206,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Celery\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Celery-Juice.png?v=1699328719\\\",\\\"productHandle\\\":\\\"celery\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700777267510,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Courage\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Courage-400m.png?v=1699328699\\\",\\\"productHandle\\\":\\\"courage\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700602384694,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Dreamtime\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Dreamtime.png?v=1699328455\\\",\\\"productHandle\\\":\\\"dreamtime\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700765438262,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Energise\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Energise.png?v=1699328397\\\",\\\"productHandle\\\":\\\"energise\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700666904886,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Gaia\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Gaia.png?v=1699328353\\\",\\\"productHandle\\\":\\\"gaia\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700569878838,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Harmony\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Harmony.png?v=1699328333\\\",\\\"productHandle\\\":\\\"harmony\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700675096886,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Insight\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Insight.png?v=1699328314\\\",\\\"productHandle\\\":\\\"insight\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700798337334,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Joy\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Joy-400m.png?v=1699328299\\\",\\\"productHandle\\\":\\\"joy\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8350784979254,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Love\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Love-400ml.png?v=1699328266\\\",\\\"productHandle\\\":\\\"love-juice-400ml\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700658942262,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Nurture\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Nurture-Salad.png?v=1699328072\\\",\\\"productHandle\\\":\\\"nurture\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700614639926,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Peace\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Peace-Nut-Milk.png?v=1699327980\\\",\\\"productHandle\\\":\\\"peace\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700761899318,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Peace +\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/PeacePlus.png?v=1699327964\\\",\\\"productHandle\\\":\\\"peace-1\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700682502454,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Prana (Vegan)\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Vegan-Prana.png?v=1699327946\\\",\\\"productHandle\\\":\\\"prana-vegan\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700684960054,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Prana - Mushroom (Bone Broth)\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Mushroom-Prana.png?v=1699327931\\\",\\\"productHandle\\\":\\\"prana-mushroom\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700687581494,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Prana - Turmeric (Bone Broth)\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Turmeric-Prana.png?v=1699327894\\\",\\\"productHandle\\\":\\\"prana-turmeric\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700794339638,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Radiant\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Radiant-400m.png?v=1699327813\\\",\\\"productHandle\\\":\\\"radiant\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8629027143990,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Shine\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Shine.png?v=1699327594\\\",\\\"productHandle\\\":\\\"shine-400ml\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700662513974,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Spiced Peace\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Spiced-Peace-Nutmilk.png?v=1699327567\\\",\\\"productHandle\\\":\\\"spiced-peace\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700609167670,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Strength\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Strength-Smoothie.png?v=1699327551\\\",\\\"productHandle\\\":\\\"strength\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700664742198,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Wandering\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Wandering.png?v=1699327020\\\",\\\"productHandle\\\":\\\"wandering\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700606087478,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Wisdom\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Wisdom.png?v=1699327005\\\",\\\"productHandle\\\":\\\"wisdom\\\",\\\"status\\\":\\\"ACTIVE\\\"},{\\\"id\\\":8700751184182,\\\"type\\\":\\\"PRODUCT\\\",\\\"title\\\":\\\"Zen\\\",\\\"imageSrc\\\":\\\"https://cdn.shopify.com/s/files/1/0738/9764/0246/files/Zen.png?v=1699326972\\\",\\\"productHandle\\\":\\\"zen\\\",\\\"status\\\":\\\"ACTIVE\\\"}]\",\"variants\":null,\"discountCondition\":null,\"sequenceNo\":1651,\"bundleType\":\"MIX_AND_MATCH\",\"showCombinedSellingPlan\":false,\"selectSubscriptionByDefault\":false,\"minimumNumberOfItems\":6,\"maximumNumberOfItems\":6,\"maxQuantity\":null,\"minQuantity\":null,\"enableSingleQuantitySelector\":null,\"allowProductQuantityForBundleValidity\":null}]","placement":"AFTER","discountPopupHeader":"you got!"}, "labels": "{\"appstle.subscription.wg.noSubscriptionLabelTextV2\":\"No Subscription\",\"appstle.subscription.wg.cancelAnytimeLabelTextV2\":\"Cancel Anytime\",\"appstle.subscription.wg.addToShipmentErrorTextV2\":\"Error\",\"appstle.subscription.wg.weeksFrequencyTextV2\":\"Weeks\",\"appstle.subscription.wg.weeklyLabelTextV2\":\"Weekly\",\"appstle.subscription.wg.addToShipmentProcessingV2\":\"Processing...\",\"appstle.subscription.wg.deliveryEveryFrequencyTextV2\":\"Delivery Every\",\"appstle.subscription.wg.subscribeAndSaveInitalV2\":\"Subscribe & save\",\"appstle.subscription.wg.daysFrequencyTextV2\":\"Days\",\"appstle.subscription.wg.monthlyLabelTextV2\":\"Monthly\",\"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.yearsFrequencyTextV2\":\"Years\",\"appstle.subscription.wg.onetimeDescriptionTextV2\":\"\",\"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\":\"One Time\",\"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.productPageUnitPriceSelectorV2\":\"\",\"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": "[]", "customCSS": ".appstle-save-badge {\n background-color: #fed83f;\n color: #3b3b3b;\n width: auto;\n border-radius: 2px;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n text-transform: uppercase;\n font-size: .5em;\n letter-spacing: 1px;\n line-height: 2;\n padding: 0 0.5em;\n margin-left: 1em;\n position: relative;\n display: none;\n transform: rotate(5deg) translate(0, 2px);\n font-weight: bold;\n}", "customerPortalCss": "", } }; sessionStorage['appstleSubscriptionConfig'] = JSON.stringify(RS.Config); var _RSConfig = _RSConfig || {}; _RSConfig.shop = 'sol-cleanse-3052.myshopify.com'; _RSConfig.shopMoneyFormat = '${{amount}}'; _RSConfig.shopMoneyFormatWithCurrencyFormat = '${{amount}} AUD'; } ★ Judge.me Reviews 93% (1309) 6% (85) 1% (17) 0% (2) 0% (0) K Custom Cleanse: Tailored to you Karen B Good afternoon Karen, P Organic Whole Food Meal Pack Pamela Johnson Nurturing and flavour filled All beautifully and carefully prepared. It was so lovely to take time off meal prep and to just rest and let myself be nurtured Hey Pamela, M Megan D. Love this cleanse... This will be my 2nd time on this cleanse and I love it, makes me feel refreshed with so much energy, less bloating and sleep really well... I intent to do twice a year for a reboot Good afternoon Megan, M Mark Sackville Another amazing cleanse I love how simple it is to do a cleanse with Sol Cleanse, I ordered mine two weeks prior it arrived Monday morning. This time I did a 3 day cleanse to reset my body, to help stop any cravings as I have had a few big weeks at work with functions and being on the road. I'm now feeling amazing with more energy, no cravings for anything sweet and definitely enjoying waking up with that spring in my step. Thanks team 🙌🏻 Hey Mark, R Re Loved the juices, smoothies and soup incredibly tasty and nourishing. Was plenty of food and didn’t feel hungry at all. Would definitely purchase again. Only problem was the daily emails only started arriving after the three day cleanse has finished which was disappointing. Hello Re,Let customers speak for us
1413 reviews
This is beautiful! It is so lovely to hear your soul is feeling nourished from healthy & delicious goodies.
Your review means a lot to us & we love the picture. Thank you!
We are so grateful for the time you have taken to leave us a review. We are pleased to hear you enjoyed your experience and were able to rest and be present.
We look forward to supporting you on this journey in the future!
It warms us to hear you have loved both your cleanses! We love the commitment you're making to a healthier you. Your review is greatly appreciated.
Wishing you a healthy & happy day!
This is awesome, thank you for sharing your experience and the benefits you feel post-cleanse. We are glad we can positively support you on this journey & appreciate the time you've taken to leave this review!
We are so happy to hear you enjoyed all of the products within you cleanse. Your feedback is appreciated, we are sorry to hear the emails were not aligned correctly. I have passed this on to our relevant team to have investigated. Thank you for taking the time to leave a review, we can't wait to continue supporting your cleansing journey!
`; document.querySelector("body").insertAdjacentHTML("beforeend", mainHTMLString); window.addEventListener("message", appstleLoyaltyIframeListener, false); function appstleLoyaltyIframeListener(event) { if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_message_to_redirect_to_account") !== -1) { window.location.href = "https://" + window.location.host + "/account"; } else if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_message_to_redirect_to_signup") !== -1) { window.location.href = "https://" + window.location.host + "/account/register"; } else if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_message_to_redirect_to_after_copied_discount_redirect_url") !== -1) { window.location.href = "https://" + window.location.host + _ALConfig?.widget_setting?.afterCopiedDiscountRedirectUrl; } else if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_message_to_apply_discount") !== -1) { var discountCode = (event.data.split("|"))[1]; var discountURL = location.origin + "/discount/" + discountCode; fetch(discountURL).then(res => { if (res.ok) { console.log("Discount Code Applied"); } else { console.log("Discount Code NOT Applied"); } }); } else if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_message_for_notification") !== -1) { var message = event?.data?.split("|")[1]; showAppstleLoyaltyToaster(message); } else if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_message_for_showWidget") !== -1) { toggleWidgetNow(); } else if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_widget_showHide") !== -1) { document.querySelector("#appstle-loyalty-button").classList.remove("appstle-loyalty-hidden"); toggleWidget(); } else if (event?.data && typeof event?.data.indexOf === "function" && event?.data?.indexOf("appstle_message_to_redirect_to_custom_url") !== -1) { if(_ALConfig?.widget_setting?.createAccountLink){ window.location.href = "https://" + window.location.host + _ALConfig?.widget_setting?.createAccountLink; } } } function removeAppstleLoyaltyWidget() { document.querySelector("#appstle-loyalty-button").classList.add("appstle-loyalty-hidden"); document.querySelector("#appstle_loyalty_iframe").classList.add("appstle-loyalty-hidden"); } function checkForWidgetRestrictions() { let isShowWidget = true; if (_ALConfig?.widget_setting?.allowedCustomersTag?.length) { let allowedTags = _ALConfig?.widget_setting?.allowedCustomersTag.split(","); if (allowedTags?.length > 0 && !_ALConfig?.customerTags?.some((tags) => allowedTags?.includes(tags))) { isShowWidget = false; } } if (_ALConfig?.widget_setting?.restrictedCustomersTag?.length && isShowWidget) { let restrictedTags = _ALConfig?.widget_setting?.restrictedCustomersTag?.split(","); if (restrictedTags?.length > 0 && _ALConfig?.customerTags?.some((tags) => restrictedTags?.includes(tags))) { isShowWidget = false; } } if (_ALConfig?.widget_setting?.blockWidgetOnPages?.length && isShowWidget) { let restrictedPages = _ALConfig?.widget_setting?.blockWidgetOnPages?.split(","); const currentPage = window?.location?.pathname; if (restrictedPages?.length > 0) { if (restrictedPages?.includes("/homepage") && currentPage === "/") { isShowWidget = false; } else if (restrictedPages?.some((page) => currentPage?.includes(page))) { isShowWidget = false; } } } if (isShowWidget) { showAppstleLoyaltyWidget(); } else { removeAppstleLoyaltyWidget(); } } checkForWidgetRestrictions(); let appstleRefferalUrl = new URL(window.location.href); let searchParams = new URLSearchParams(appstleRefferalUrl.search); let referralPage = searchParams.get("appstle_referral"); if (referralPage) { document.querySelector("#appstle_loyalty_iframe").classList.add("open"); document.querySelector("#appstle_loyalty_iframe").classList.remove("appstle-loyalty-hidden"); setTimeout(function() { document.querySelector("#appstle_loyalty_iframe").classList.toggle("show-close-icon"); }, 900); } if (window?.location?.hash?.indexOf("#appstle-refer") !== -1) { handleDeepLink(); } function handleDeepLink() { document.querySelector("#appstle_loyalty_iframe").classList.toggle("open"); showAppstleLoyaltyWidget(); setTimeout(function() { document.querySelector("#appstle_loyalty_iframe").classList.toggle("show-close-icon"); }, 900); } function showAppstleLoyaltyWidget() { document.querySelector("#appstle-loyalty-button").classList.remove("appstle-loyalty-hidden"); document.querySelector("#appstle_loyalty_iframe").classList.remove("appstle-loyalty-hidden"); } function toggleWidget() { 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); } } function toggleWidgetNow() { if (location?.hash?.indexOf("#appstle-loyalty") !== -1 && _ALConfig.widget_setting.showWidget) { toggleWidget(); } } document.querySelector(".appstle-loyalty-button").addEventListener("click", toggleWidget); if (_ALConfig?.widget_setting?.widgetPosition === "LEFT") { document.getElementById("appstle_loyalty_iframe").classList.add("appstle-loyalty-left"); document.querySelector(".appstle-loyalty-button").classList.add("appstle-loyalty-left"); document.getElementById("appstle_loyalty_iframe").classList.add("appstle-loyalty-left"); document.getElementById("snackbar").classList.add("left_snackbar"); } else { document.getElementById("appstle_loyalty_iframe").classList.add("appstle-loyalty-right"); document.querySelector(".appstle-loyalty-button").classList.add("appstle-loyalty-right"); document.getElementById("snackbar").classList.add("right_snackbar"); } document.getElementById("loyalty-widget-title").innerHTML = _ALConfig?.widget_setting?.widgetTitle || "Appstle Loyalty"; const alIframeSrc = "" + " " + "
" + "" + "body" + ">" + ""; addEventListener("load", (event) => { 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(); }); }); 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 }); 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(); } let index = 0; function showAppstleLoyaltyToaster(msg) { var snackBar = document.getElementById("snackbar"); snackBar.classList.add("show"); snackBar.insertAdjacentHTML("beforeend", `
${msg}
`); const el = index; setTimeout(function() { if (document.getElementById(`elem${el}`)) document.getElementById(`elem${el}`).remove(); }, 5000); index++; } // showAppstleLoyaltyToaster("Test message"); function closeSnackBar(el) { document.getElementById(el).remove(); } 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/0738/9764/0246/t/35/assets/appstle_loyalty.js?v=1693555390"); 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/0738/9764/0246/t/35/assets/appstle_loyalty.css?v=1693555391"; head.appendChild(link); } else { setTimeout(() => { initiateAppstleLoyaltyPage(); }, 2000); } } initiateAppstleLoyaltyPage();