Repository navigation
Expand file tree
/
Copy pathappstle-membership-init.js
More file actions
156 lines (144 loc) · 6.57 KB
/
Copy pathappstle-membership-init.js
File metadata and controls
156 lines (144 loc) · 6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
(function (window, k) {
if (!window.AppstleMembershipIncluded && (!urlIsProductPage() || 'V1' === 'V2')) {
window.AppstleMembershipIncluded = true;
appstleLoadScript = function (src, callback) {
var script = document.createElement("script");
script.charset = "utf-8";
script.async = true;
script.src = src;
script.onload = script.onreadystatechange = function () {
if (!script.readyState || /loaded|complete/.test(script.readyState)) {
script.onload = script.onreadystatechange = null;
script = k;
callback && callback();
}
};
document.getElementsByTagName("head")[0].appendChild(script)
};
appstleLoadScript("https://cdn.shopify.com/s/files/1/0665/5000/6018/t/21/assets/appstle-membership.js?v=1684147482");
window.AM = Window.AM || {};
AM.Config = {
"selectors": {
"payment_button_selectors": "form[action$='/cart/add'] .shopify-payment-button",
"subscriptionLinkSelector": "#MainContent > div > div:nth-child(2)",
"atcButtonPlacement": "BEFORE",
"subscriptionLinkPlacement": "BEFORE"
},
"useUrlWithCustomerId": false,
"atcButtonSelector": "div.product-form__buttons",
"moneyFormat": "{% raw %}${{amount}}{% endraw %}",
"oneTimePurchaseText": "One Time Purchase",
"shop": "wagashiwith.myshopify.com",
"deliveryText": "delivery",
"purchaseOptionsText": "Membership Options",
"manageSubscriptionButtonText": "Manage Membership",
"subscriptionOptionText": "Join Now",
"sellingPlanSelectTitle": "DELIVERY FREQUENCY",
"subscriptionPriceDisplayText": "",
"tooltipTitle": "Membership detail",
"api_key": "jDmpvitgzgF7",
"showTooltipOnClick": "false",
"tooltipDesctiption": "<strong>Have complete control of your memberships<\/strong><br\/><br\/>Skip, reschedule, edit, cancel deliveries anytime matching your needs.",
"tooltipDescriptionOnPrepaidPlan": "<b>Prepaid Plan Details<\/b><\/br> Total price: {{{totalPrice}}} ( Price for every delivery: {{{pricePerDelivery}}})",
"tooltipDescriptionOnMultipleDiscount": "<b>Discount Details<\/b><\/br> Initial discount is {{discountOne}} and then {{discountTwo}}",
"tooltipDescriptionCustomization": "{{{defaultTooltipDescription}}} <\/br> {{{prepaidDetails}}} <\/br> {{{discountDetails}}}",
"orderStatusManageSubscriptionTitle": "Membership",
"orderStatusManageSubscriptionDescription": "Continue to your account to view and manage your memberships. Please use the same email address that you used to buy the membership.",
"orderStatusManageSubscriptionButtonText": "Manage your membership",
"subscriptionOptionSelectedByDefault" : false,
"totalPricePerDeliveryText" : "{{{prepaidPerDeliveryPrice}}}\/delivery",
"memberOnlySellingPlansJson": {},
"fieldsBySellingPlanId": "{}",
"rulesByCustomerTag": "{}",
"membershipByCustomerTag": "{}",
"nonMemberOnlySellingPlansJson": {},
"sellingPlansJson": [],
"widgetEnabled": true,
"showTooltip" : true,
"sortByDefaultSequence": false,
"showSubOptionBeforeOneTime": false,
"showStaticTooltip": false,
"showAppstleLink": false,
"sellingPlanTitleText" : "{{sellingPlanName}} ({{{sellingPlanPrice}}}\/delivery)",
"oneTimePriceText" : "{{{price}}}",
"selectedPayAsYouGoSellingPlanPriceText" : "{{{price}}}",
"selectedPrepaidSellingPlanPriceText" : "{{{pricePerDelivery}}}",
"selectedDiscountFormat" : "SAVE {{{selectedDiscountPercentage}}}",
"manageSubscriptionBtnFormat" : "<a href='apps\/memberships' class='appstle_manageSubBtn' ><button class='btn' style='padding: 2px 20px'>Manage Membership<\/button><a><br><br>",
"manageSubscriptionUrl" : "apps\/memberships",
"appstlePlanId": 1,
"showCheckoutSubscriptionBtn": true,
"disableLoadingJquery": false,
"enableMessagingForNonMembers": "false",
"nonMemberMessaging": "Please login to avail the membership perks.",
"showMembershipBanner": "true",
"showDiscountWidget": "false",
"discountBadgeImageLink": "",
"widgetBadgeImageLink": "",
"productPagePriceDescriptionBlockPriceSelector": "",
"productPagePriceDescriptionBlockParentSelector": "",
"priceBlockSelector": "",
"parentSelector": "",
"reBuyEnabled": "false",
"switchRadioButtonWidget": false,
"enableAddJSInterceptor": false,
"css": {
"appstle_membership_widget": {
"margin-top": "" ,
"margin-bottom": "",
},
"appstle_membership_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_membership_final_price": {
"color": "",
},
"appstle_widget_text_color": {
"color": "",
},
"appstle_selected_background": {
"background": "transparent",
},
"customCSS": "",
"customerPortalCss": "",
"priceSelector": "span.price-item.price-item--regular",
"landingPagePriceSelector": "",
"quickViewClickSelector": "",
"badgeTop": "",
"pricePlacement": "BEFORE",
}
};
}
function urlIsProductPage() {
// return null != decodeURIComponent(window.location.pathname).match(/\/products\/(([a-zA-Z0-9]|[\-\.\_\~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[\ud83c\ud83d\ud83e][\ud000-\udfff]){1,})\/?/)
return decodeURIComponent(window.location.pathname).includes('/products/');
}
}
)(window);