wickes-css2 2.103.0-RG-1742-billie-30-60-90-days.1 → 2.103.0-RG-1742-billie-30-60-90-days.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/css/components/checkout-chip.css +1 -0
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/components/checkout-payment-repayment-terms.css +1 -0
- package/build/css/components/energy-efficiency.css +1 -0
- package/build/css/components/global-search.css +1 -0
- package/build/css/components/kitchen/strip-stickers.css +1 -0
- package/build/css/components/legal-info.css +1 -0
- package/build/css/components/loader.css +1 -0
- package/build/css/components/long-banner.css +1 -0
- package/build/css/components/payment-details-BPS-form.css +1 -0
- package/build/css/components/pdf-loader.css +1 -0
- package/build/css/components/pdp-favourite-product.css +1 -0
- package/build/css/components/plp-favourite-product.css +1 -0
- package/build/css/components/price-block-v2-critical.css +1 -0
- package/build/css/components/price-block-v2.css +1 -0
- package/build/css/components/special-opening-schedule-v2.css +1 -0
- package/build/css/components/special-opening-schedule.css +1 -0
- package/build/css/components/store-locator-about.css +1 -0
- package/build/css/components/store-locator-facilities.css +1 -0
- package/build/css/components/store-locator-lookup.css +1 -0
- package/build/css/components/store-locator-v2-details.css +1 -0
- package/build/css/components/strip-stickers.css +1 -0
- package/build/css/components/tile-calculator.css +1 -0
- package/build/css/components/trade-pro-extras.css +1 -0
- package/build/css/main.css +1 -1
- package/build/css/pages/bicester-header.css +1 -0
- package/build/css/pages/bicester-project-list.css +1 -0
- package/build/css/pages/checkout-new.css +1 -0
- package/build/css/pages/checkout.css +1 -0
- package/build/css/pages/design-appointment.css +1 -0
- package/build/css/pages/home-movers.css +1 -0
- package/build/css/pages/iframe-paypage.css +1 -0
- package/build/css/pages/my-account-v2.css +1 -0
- package/build/css/pages/my-account.css +1 -0
- package/build/css/pages/new-usp-bar.css +1 -0
- package/build/css/pages/oldweb_header.css +1 -0
- package/build/css/pages/page_account-deletion.css +1 -0
- package/build/css/pages/page_act-trade-pro.css +1 -0
- package/build/css/pages/page_address-book.css +1 -0
- package/build/css/pages/page_bathroom-trends.css +1 -0
- package/build/css/pages/page_book-consultant-thank-you-new.css +1 -0
- package/build/css/pages/page_change-password.css +1 -0
- package/build/css/pages/page_checkout-payment-details.css +1 -0
- package/build/css/pages/page_checkout_delivery-new.css +1 -0
- package/build/css/pages/page_cms_homepage.css +1 -0
- package/build/css/pages/page_contact-us.css +1 -0
- package/build/css/pages/page_content.css +1 -0
- package/build/css/pages/page_coshh.css +1 -0
- package/build/css/pages/page_default-store.css +1 -0
- package/build/css/pages/page_discount.css +1 -0
- package/build/css/pages/page_empty-basket.css +1 -0
- package/build/css/pages/page_favourite-list.css +1 -0
- package/build/css/pages/page_fdl-management.css +1 -0
- package/build/css/pages/page_fdl-product.css +1 -0
- package/build/css/pages/page_fi.css +1 -0
- package/build/css/pages/page_forgotten-password.css +1 -0
- package/build/css/pages/page_half-login.css +1 -0
- package/build/css/pages/page_home.css +1 -0
- package/build/css/pages/page_hotspot-guttering.css +1 -0
- package/build/css/pages/page_in-store-checkout.css +1 -0
- package/build/css/pages/page_in-store_MVP_order-summary-submitted.css +1 -0
- package/build/css/pages/page_in-store_MVP_order-summary.css +1 -0
- package/build/css/pages/page_installation.css +1 -0
- package/build/css/pages/page_installer.css +1 -0
- package/build/css/pages/page_installer_form.css +1 -0
- package/build/css/pages/page_kitchen-claims.css +1 -0
- package/build/css/pages/page_kitchen-list.css +1 -0
- package/build/css/pages/page_login.css +1 -0
- package/build/css/pages/page_marketing-preferences.css +1 -0
- package/build/css/pages/page_merged-basket.css +1 -0
- package/build/css/pages/page_my-account_tradePro.css +1 -0
- package/build/css/pages/page_my-order.css +1 -0
- package/build/css/pages/page_my-orders.css +1 -0
- package/build/css/pages/page_new-checkout-forgot.css +1 -0
- package/build/css/pages/page_new-checkout_login-register.css +1 -0
- package/build/css/pages/page_no-results.css +1 -0
- package/build/css/pages/page_online-exclusive.css +1 -0
- package/build/css/pages/page_paint-mixing-error.css +1 -0
- package/build/css/pages/page_personal-details.css +1 -0
- package/build/css/pages/page_pre_home.css +1 -0
- package/build/css/pages/page_pre_home_thank-you.css +1 -0
- package/build/css/pages/page_product-details-critical.css +1 -0
- package/build/css/pages/page_product-details-v2-critical.css +1 -0
- package/build/css/pages/page_product-details-v2.css +1 -0
- package/build/css/pages/page_product-details.css +1 -0
- package/build/css/pages/page_product_search.css +1 -0
- package/build/css/pages/page_products-list-combined.css +1 -0
- package/build/css/pages/page_products-list-phone.css +1 -0
- package/build/css/pages/page_products-list.css +1 -0
- package/build/css/pages/page_products-list_v2.css +1 -0
- package/build/css/pages/page_projects.css +1 -0
- package/build/css/pages/page_quiz.css +1 -0
- package/build/css/pages/page_rate-review.css +1 -0
- package/build/css/pages/page_registration.css +1 -0
- package/build/css/pages/page_shopping-cart-v2.css +1 -0
- package/build/css/pages/page_shopping-cart.css +1 -0
- package/build/css/pages/page_split-orders.css +1 -0
- package/build/css/pages/page_store-locator-details.css +1 -0
- package/build/css/pages/page_store-locator.css +1 -0
- package/build/css/pages/page_thankyou.css +1 -0
- package/build/css/pages/page_ti.css +1 -0
- package/build/css/pages/page_tiling-calculator-generic.css +1 -0
- package/build/css/pages/page_top-rated.css +1 -0
- package/build/css/pages/page_track-my-order.css +1 -0
- package/build/css/pages/page_track_your_order.css +1 -0
- package/build/css/pages/page_trade_installer.css +1 -0
- package/build/css/pages/page_upd-pass.css +1 -0
- package/build/css/pages/page_wismo-details.css +1 -0
- package/build/css/pages/page_wismo-order-history.css +1 -0
- package/build/css/pages/page_wismo-orders.css +1 -0
- package/build/css/pages/print_quiz.css +1 -0
- package/build/css/pages/sticky_header.css +1 -0
- package/build/css/pages/tradePro-about.css +1 -0
- package/build/css/pages/tradePro-address-book.css +1 -0
- package/build/css/pages/tradePro-delivery-details.css +1 -0
- package/build/css/pages/tradePro-discount.css +1 -0
- package/build/css/pages/tradePro-order-history.css +1 -0
- package/build/css/pages/tradePro-payment-details.css +1 -0
- package/build/css/pages/tradePro-rewards-old.css +1 -0
- package/build/css/pages/tradePro-rewards.css +1 -0
- package/build/css/pages/tradePro-signup.css +1 -0
- package/build/css/pages/tradePro-thankyou-activate.css +1 -0
- package/build/js/emulation.min.js +145 -97
- package/build/js/page/checkout-payment-details.js +96 -43
- package/package.json +1 -1
- package/src/components/checkout-chip.hbs +15 -0
- package/src/components/checkout-payment-details-v2.hbs +35 -36
- package/src/components/checkout-payment-repayment-terms.hbs +3 -16
- package/src/data/data_billie-terms.json +7 -0
- package/src/js/emulation/checkout-payment-details.js +8 -8
- package/src/js/emulation/forms.js +99 -88
- package/src/js/emulation/paymentLoader.js +4 -3
- package/src/js/emulation/repayment-toggle.js +35 -0
- package/src/js/page/checkout-payment-details.js +96 -43
- package/src/scss/components/checkout-chip.scss +64 -0
- package/src/scss/components/checkout-payment-details-v2.scss +0 -1
- package/src/scss/components/checkout-payment-repayment-terms.scss +27 -91
- package/src/scss/main.scss +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
|
-
Wick.Forms = (function(){
|
|
2
|
+
Wick.Forms = (function() {
|
|
3
3
|
var fieldRow = '.form-row[data-row-required]',
|
|
4
4
|
field = '.form-row__field',
|
|
5
5
|
fieldError = '.form-row__error',
|
|
@@ -9,43 +9,44 @@ Wick.Forms = (function(){
|
|
|
9
9
|
// validationError = '<div class="form-row__error">Error message here</div>',
|
|
10
10
|
$forgotPassword = $('.link-forgot-password'),
|
|
11
11
|
scenarios = [{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
12
|
+
condition: function() {
|
|
13
|
+
// fill in the valid returning customer's details
|
|
14
|
+
// Email: responsive@test.com; Password: 123456
|
|
15
|
+
return $('#login-email').val() === 'responsive@test.com' && $('#password').val() === '123456';
|
|
16
|
+
},
|
|
17
|
+
action: function() {
|
|
18
|
+
// redirected to the homepage
|
|
19
|
+
Wick.User.login();
|
|
20
|
+
window.location.href = './';
|
|
22
21
|
},
|
|
22
|
+
},
|
|
23
23
|
{
|
|
24
|
-
condition: function(){
|
|
24
|
+
condition: function() {
|
|
25
25
|
// continue as a new user with "test+random@user.com"
|
|
26
26
|
return $('#registration-email').val().length;
|
|
27
27
|
// return $('#registration-email').val() === 'test+random@user.com';
|
|
28
28
|
},
|
|
29
|
-
action: function(){
|
|
29
|
+
action: function() {
|
|
30
30
|
// redirected to the register form
|
|
31
31
|
window.location.href = './page_registration.html';
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
condition: function(){
|
|
35
|
+
condition: function() {
|
|
36
36
|
// When I click forgotten password link
|
|
37
37
|
},
|
|
38
|
-
action: function(){
|
|
38
|
+
action: function() {
|
|
39
39
|
// redirected on the "Forgotten Password" page
|
|
40
40
|
window.location.href = './page_forgotten-password.html';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
]
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
validationError = function(errorMsg) {
|
|
46
|
+
return `<div class="form-row__error"> ${errorMsg || 'Error message here'}</div>`;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
function isElementInViewport(el) {
|
|
49
50
|
if (typeof jQuery === 'function' && el instanceof jQuery) {
|
|
50
51
|
el = el[0];
|
|
51
52
|
}
|
|
@@ -58,15 +59,21 @@ Wick.Forms = (function(){
|
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
var showValidationErrors = function
|
|
62
|
+
var showValidationErrors = function(form, errorMsg) {
|
|
62
63
|
var $form = $(form);
|
|
63
64
|
if (!$form.hasClass(formInvalid)) {
|
|
64
65
|
$form.find('.form-row__error').remove();
|
|
65
|
-
$form.
|
|
66
|
+
var $rows = $form.find(fieldRow).filter(function() {
|
|
67
|
+
return $(this).is(':visible');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
$rows.append(validationError(errorMsg)).addClass(rowValidationError);
|
|
66
71
|
}
|
|
67
72
|
|
|
68
|
-
var $firstMsg = $form.find(fieldRow).
|
|
69
|
-
|
|
73
|
+
var $firstMsg = $form.find(fieldRow).filter(function() {
|
|
74
|
+
return $(this).is(':visible');
|
|
75
|
+
}).first();
|
|
76
|
+
if ($firstMsg.length && !isElementInViewport($firstMsg)) {
|
|
70
77
|
var inModal = $firstMsg.closest('.modal').length,
|
|
71
78
|
$scrollableEl = inModal ? $firstMsg.closest('.modal') : $('html, body'),
|
|
72
79
|
y = inModal ? 0 : $firstMsg.offset().top - 30;
|
|
@@ -75,22 +82,26 @@ Wick.Forms = (function(){
|
|
|
75
82
|
}
|
|
76
83
|
};
|
|
77
84
|
|
|
78
|
-
var clearValidationErrors = function
|
|
85
|
+
var clearValidationErrors = function(form) {
|
|
79
86
|
var $form = $(form);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
|
|
88
|
+
$form.removeClass(formInvalid);
|
|
89
|
+
|
|
90
|
+
$form.find(fieldRow)
|
|
91
|
+
.removeClass(rowValidationError)
|
|
92
|
+
.find(fieldError).remove();
|
|
93
|
+
|
|
94
|
+
$form.find(fieldError).remove();
|
|
85
95
|
};
|
|
86
96
|
|
|
87
|
-
|
|
97
|
+
|
|
98
|
+
var handleSmoothScroll = function() {
|
|
88
99
|
$('html, body').animate({
|
|
89
|
-
scrollTop: $('.cards-store-list').offset().top - 60
|
|
100
|
+
scrollTop: $('.cards-store-list').offset().top - 60,
|
|
90
101
|
}, 300);
|
|
91
102
|
};
|
|
92
103
|
|
|
93
|
-
var handleFormSubmit = function
|
|
104
|
+
var handleFormSubmit = function() {
|
|
94
105
|
var form = this;
|
|
95
106
|
|
|
96
107
|
if ($(form).is('#form-login') || $(form).is('#form-register')) {
|
|
@@ -104,21 +115,21 @@ Wick.Forms = (function(){
|
|
|
104
115
|
}
|
|
105
116
|
|
|
106
117
|
if ($(form).is('#form-forgotten-password')) {
|
|
107
|
-
if ($(form).find('#email').val().length){
|
|
118
|
+
if ($(form).find('#email').val().length) {
|
|
108
119
|
window.location.href = './page_upd-pass.html';
|
|
109
120
|
return false;
|
|
110
121
|
}
|
|
111
122
|
}
|
|
112
123
|
|
|
113
124
|
if ($(form).is('#form-forgotten-password-popup')) {
|
|
114
|
-
if ($(form).find('#email').val().length){
|
|
125
|
+
if ($(form).find('#email').val().length) {
|
|
115
126
|
window.location.href = './page_checkout_sign-in.html';
|
|
116
127
|
return false;
|
|
117
128
|
}
|
|
118
129
|
}
|
|
119
130
|
|
|
120
131
|
if ($(form).is('#checkout-form-forgotten-password-popup')) {
|
|
121
|
-
if ($(form).find('#email').val().length){
|
|
132
|
+
if ($(form).find('#email').val().length) {
|
|
122
133
|
$('.modal-reset-wrap').addClass('d-block');
|
|
123
134
|
$('.request-pass').addClass('d-none');
|
|
124
135
|
$('.modal-title').text('Password Reset');
|
|
@@ -127,7 +138,7 @@ Wick.Forms = (function(){
|
|
|
127
138
|
}
|
|
128
139
|
|
|
129
140
|
if ($(form).is('.update-pass')) {
|
|
130
|
-
if ($(form).find('#new-password').val().length && $(form).find('#confirmed-password').val().length){
|
|
141
|
+
if ($(form).find('#new-password').val().length && $(form).find('#confirmed-password').val().length) {
|
|
131
142
|
window.location.href = './page_login.html';
|
|
132
143
|
return false;
|
|
133
144
|
}
|
|
@@ -136,7 +147,7 @@ Wick.Forms = (function(){
|
|
|
136
147
|
if ($(form).is('.change-email')) {
|
|
137
148
|
if ($(form).find('#new-email').val().length &&
|
|
138
149
|
$(form).find('#confirm-new-email').val().length &&
|
|
139
|
-
$(form).find('#password').val().length){
|
|
150
|
+
$(form).find('#password').val().length) {
|
|
140
151
|
window.location.href = './page_my-account.html';
|
|
141
152
|
return false;
|
|
142
153
|
}
|
|
@@ -145,7 +156,7 @@ Wick.Forms = (function(){
|
|
|
145
156
|
if ($(form).is('.form-change-password')) {
|
|
146
157
|
if ($(form).find('#current-password').val().length &&
|
|
147
158
|
$(form).find('#new-password').val().length &&
|
|
148
|
-
$(form).find('#confirm-password').val().length){
|
|
159
|
+
$(form).find('#confirm-password').val().length) {
|
|
149
160
|
window.location.href = './page_my-account.html';
|
|
150
161
|
return false;
|
|
151
162
|
}
|
|
@@ -157,14 +168,14 @@ Wick.Forms = (function(){
|
|
|
157
168
|
$(form).find('#postcode').val().length &&
|
|
158
169
|
$(form).find('#email').val().length &&
|
|
159
170
|
$(form).find('#password').val().length &&
|
|
160
|
-
$(form).find('#confirm-password').val().length){
|
|
171
|
+
$(form).find('#confirm-password').val().length) {
|
|
161
172
|
window.location.href = './page_my-account.html';
|
|
162
173
|
return false;
|
|
163
174
|
}
|
|
164
175
|
}
|
|
165
176
|
|
|
166
177
|
if ($(form).is('.form-personal-details')) {
|
|
167
|
-
if ($(form).find('#first-name').val().length && $(form).find('#surname').val().length){
|
|
178
|
+
if ($(form).find('#first-name').val().length && $(form).find('#surname').val().length) {
|
|
168
179
|
window.location.href = './page_my-account.html';
|
|
169
180
|
return false;
|
|
170
181
|
}
|
|
@@ -172,26 +183,26 @@ Wick.Forms = (function(){
|
|
|
172
183
|
|
|
173
184
|
if ($(form).is('.form-address-details')) {
|
|
174
185
|
if ($(form).find('#first-name').val().length &&
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
186
|
+
$(form).find('#second-name').val().length &&
|
|
187
|
+
$(form).find('#address1').val().length &&
|
|
188
|
+
$(form).find('#town-city').val().length &&
|
|
189
|
+
$(form).find('#mobile-telephone').val().length) {
|
|
179
190
|
window.location.href = './page_my-account_address-book.html';
|
|
180
191
|
return false;
|
|
181
192
|
}
|
|
182
193
|
}
|
|
183
194
|
|
|
184
195
|
if ($(form).is('.form-locator')) {
|
|
185
|
-
if ($(form).find('#store-id').val()){
|
|
196
|
+
if ($(form).find('#store-id').val()) {
|
|
186
197
|
window.location.href = './page_store-locator-details.html';
|
|
187
198
|
return false;
|
|
188
199
|
}
|
|
189
200
|
}
|
|
190
201
|
|
|
191
202
|
if ($(form).is('.form-locator-list')) {
|
|
192
|
-
if ($(form).find('#postcode-town').val().length){
|
|
203
|
+
if ($(form).find('#postcode-town').val().length) {
|
|
193
204
|
var actionAfterSubmit = $(form).attr('data-action');
|
|
194
|
-
if (actionAfterSubmit === 'scroll-to-list'){
|
|
205
|
+
if (actionAfterSubmit === 'scroll-to-list') {
|
|
195
206
|
clearValidationErrors(this);
|
|
196
207
|
handleSmoothScroll();
|
|
197
208
|
} else {
|
|
@@ -202,7 +213,7 @@ Wick.Forms = (function(){
|
|
|
202
213
|
}
|
|
203
214
|
|
|
204
215
|
if ($(form).is('#form-mini-basket')) {
|
|
205
|
-
if (Wick.User.isLoggedIn()){
|
|
216
|
+
if (Wick.User.isLoggedIn()) {
|
|
206
217
|
window.location.href = './page_checkout_delivery-address.html';
|
|
207
218
|
} else {
|
|
208
219
|
window.location.href = './page_checkout_sign-in.html';
|
|
@@ -210,7 +221,7 @@ Wick.Forms = (function(){
|
|
|
210
221
|
return false;
|
|
211
222
|
}
|
|
212
223
|
|
|
213
|
-
function isNotEmpty(field){
|
|
224
|
+
function isNotEmpty(field) {
|
|
214
225
|
var $field = $(field);
|
|
215
226
|
var type = ($field.attr('type') || '').toLowerCase();
|
|
216
227
|
|
|
@@ -234,7 +245,7 @@ Wick.Forms = (function(){
|
|
|
234
245
|
|
|
235
246
|
if ($(form).is('#form-checkout-your-details')) {
|
|
236
247
|
var requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
237
|
-
if (_.every(requiredFields, isNotEmpty)){
|
|
248
|
+
if (_.every(requiredFields, isNotEmpty)) {
|
|
238
249
|
window.location.href = $(form).attr('data-action');
|
|
239
250
|
return false;
|
|
240
251
|
}
|
|
@@ -242,7 +253,7 @@ Wick.Forms = (function(){
|
|
|
242
253
|
|
|
243
254
|
if ($(form).is('#checkout-your-details-modal')) {
|
|
244
255
|
var requiredFields = $(form).find('[data-row-required]:visible :input');
|
|
245
|
-
if (_.every(requiredFields, isNotEmpty)){
|
|
256
|
+
if (_.every(requiredFields, isNotEmpty)) {
|
|
246
257
|
$('#modalDeliveryEdit').modal('hide');
|
|
247
258
|
return false;
|
|
248
259
|
}
|
|
@@ -256,15 +267,15 @@ Wick.Forms = (function(){
|
|
|
256
267
|
}
|
|
257
268
|
}
|
|
258
269
|
|
|
259
|
-
if ($(form).is('.checkout-register')){
|
|
270
|
+
if ($(form).is('.checkout-register')) {
|
|
260
271
|
if ($(form).find('#password').val().length &&
|
|
261
|
-
|
|
272
|
+
$(form).find('#confirm-password').val().length) {
|
|
262
273
|
window.location.href = './page_my-account.html';
|
|
263
274
|
return false;
|
|
264
275
|
}
|
|
265
276
|
}
|
|
266
277
|
|
|
267
|
-
if ($(form).is('#form-checkout-voucher')){
|
|
278
|
+
if ($(form).is('#form-checkout-voucher')) {
|
|
268
279
|
if ($(form).find('#voucher-code').val().length) {
|
|
269
280
|
return false;
|
|
270
281
|
}
|
|
@@ -276,11 +287,11 @@ Wick.Forms = (function(){
|
|
|
276
287
|
}
|
|
277
288
|
}
|
|
278
289
|
|
|
279
|
-
if ($(form).is('.header-search')){
|
|
290
|
+
if ($(form).is('.header-search')) {
|
|
280
291
|
window.location.href = './page_search-results.html';
|
|
281
292
|
}
|
|
282
293
|
|
|
283
|
-
if ($(form).is('.click-and-collect__locator-form')){
|
|
294
|
+
if ($(form).is('.click-and-collect__locator-form')) {
|
|
284
295
|
var $form = $(form);
|
|
285
296
|
if ($form.find('#click-and-collect-town').val().length) {
|
|
286
297
|
clearValidationErrors(this);
|
|
@@ -293,24 +304,24 @@ Wick.Forms = (function(){
|
|
|
293
304
|
return false;
|
|
294
305
|
}
|
|
295
306
|
|
|
296
|
-
if($(form).is('.form-track-order')) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
if ($form.find('#order').val().length &&
|
|
300
|
-
$form.find('#tel').val().length &&
|
|
301
|
-
$form.find('#email').val().length &&
|
|
302
|
-
$form.find('#postcode').val().length) {
|
|
303
|
-
clearValidationErrors(this);
|
|
304
|
-
} else if (!$form.hasClass(formInvalid)) {
|
|
305
|
-
$form.addClass(formInvalid);
|
|
306
|
-
|
|
307
|
-
$(fieldRow).each(function() {
|
|
308
|
-
$(this).addClass(rowValidationError)
|
|
309
|
-
.append('<div class="form-row__error">' + $(this).data('message') + '</div>');
|
|
310
|
-
});
|
|
311
|
-
}
|
|
307
|
+
if ($(form).is('.form-track-order')) {
|
|
308
|
+
var $form = $(form);
|
|
312
309
|
|
|
313
|
-
|
|
310
|
+
if ($form.find('#order').val().length &&
|
|
311
|
+
$form.find('#tel').val().length &&
|
|
312
|
+
$form.find('#email').val().length &&
|
|
313
|
+
$form.find('#postcode').val().length) {
|
|
314
|
+
clearValidationErrors(this);
|
|
315
|
+
} else if (!$form.hasClass(formInvalid)) {
|
|
316
|
+
$form.addClass(formInvalid);
|
|
317
|
+
|
|
318
|
+
$(fieldRow).each(function() {
|
|
319
|
+
$(this).addClass(rowValidationError)
|
|
320
|
+
.append('<div class="form-row__error">' + $(this).data('message') + '</div>');
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return false;
|
|
314
325
|
}
|
|
315
326
|
|
|
316
327
|
if ($(form).is('#edit-billing-address')) {
|
|
@@ -326,28 +337,28 @@ Wick.Forms = (function(){
|
|
|
326
337
|
};
|
|
327
338
|
|
|
328
339
|
var scrollLocatorListPage = function() {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
340
|
+
var isLocatorListPage = $('.cards-store-list').length;
|
|
341
|
+
var isScrollNeeded = window.location.hash === '#stores-list';
|
|
342
|
+
if (isLocatorListPage && isScrollNeeded) {
|
|
343
|
+
handleSmoothScroll();
|
|
344
|
+
}
|
|
334
345
|
};
|
|
335
346
|
|
|
336
|
-
let bindEvents = function
|
|
347
|
+
let bindEvents = function() {
|
|
337
348
|
let selector = excludedClassesForForm.reduce((acc, className) => {
|
|
338
349
|
return acc + ':not([class^="' + className + '"])';
|
|
339
350
|
}, 'form');
|
|
340
351
|
$(document).on('submit', selector, handleFormSubmit);
|
|
341
352
|
$forgotPassword.on('click', scenarios[2].action);
|
|
342
|
-
$('.btn-cancel').on('click', function(){
|
|
353
|
+
$('.btn-cancel').on('click', function() {
|
|
343
354
|
window.location.href = './page_my-account.html';
|
|
344
355
|
});
|
|
345
|
-
$('.btn-previous').on('click', function(){
|
|
356
|
+
$('.btn-previous').on('click', function() {
|
|
346
357
|
window.location.href = './page_login.html';
|
|
347
358
|
});
|
|
348
359
|
};
|
|
349
360
|
|
|
350
|
-
var init = function
|
|
361
|
+
var init = function() {
|
|
351
362
|
bindEvents();
|
|
352
363
|
scrollLocatorListPage();
|
|
353
364
|
};
|
|
@@ -356,6 +367,6 @@ Wick.Forms = (function(){
|
|
|
356
367
|
|
|
357
368
|
return {
|
|
358
369
|
showValidationErrors: showValidationErrors,
|
|
359
|
-
clearValidationErrors: clearValidationErrors
|
|
360
|
-
}
|
|
370
|
+
clearValidationErrors: clearValidationErrors,
|
|
371
|
+
};
|
|
361
372
|
})();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
|
|
1
3
|
const paymentLoader= '.payment-loader';
|
|
2
4
|
const paymentLoaderHideClass= 'payment-loader--hidden';
|
|
3
5
|
const paymentLoaderModal = '.payment-loader__modal'
|
|
@@ -5,11 +7,10 @@ const paymentTypeSelectors = {
|
|
|
5
7
|
apple: '.apple__button',
|
|
6
8
|
google: '.google__button',
|
|
7
9
|
clearpay: '#checkout-payment-details-clearpay',
|
|
8
|
-
billie: '#checkout-payment-details-billie, .billie__button',
|
|
9
10
|
paypal: '#checkout-payment-details-paypal'
|
|
10
11
|
};
|
|
11
12
|
|
|
12
|
-
function
|
|
13
|
+
Wick.showPaymentLoader = function(paymentType) {
|
|
13
14
|
$(paymentLoader).find(`${paymentLoaderModal} > div`).hide();
|
|
14
15
|
$(`.${paymentType}-checkout-logo`).show();
|
|
15
16
|
$(`${paymentLoader} .spinner`).show();
|
|
@@ -21,5 +22,5 @@ function showPaymentLoader(paymentType) {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
Object.entries(paymentTypeSelectors).forEach(([type, triggerSelector]) => {
|
|
24
|
-
$(document).on('click', triggerSelector, () => showPaymentLoader(type));
|
|
25
|
+
$(document).on('click', triggerSelector, () => Wick.showPaymentLoader(type));
|
|
25
26
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.RepaymentToggle = (function () {
|
|
4
|
+
const SELECTORS = {
|
|
5
|
+
repaymentRadio: 'input[name="repaymentTerms"]',
|
|
6
|
+
term: '.billie-info .term',
|
|
7
|
+
paymentMethod: '[name="payment-method"]'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function updateTerm(value) {
|
|
11
|
+
const $term = $(SELECTORS.term);
|
|
12
|
+
if (!$term.length) return;
|
|
13
|
+
|
|
14
|
+
$term.text(value);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function bindEvents () {
|
|
18
|
+
$(document).on('change', SELECTORS.repaymentRadio, function () {
|
|
19
|
+
const value = $(this).val();
|
|
20
|
+
if (!value) return;
|
|
21
|
+
|
|
22
|
+
updateTerm(value);
|
|
23
|
+
|
|
24
|
+
const currentMethod = $(SELECTORS.paymentMethod + ':checked').val();
|
|
25
|
+
if (currentMethod !== 'billie') return;
|
|
26
|
+
|
|
27
|
+
if (typeof Wick.showPaymentLoader === 'function') {
|
|
28
|
+
Wick.showPaymentLoader('billie');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
bindEvents();
|
|
35
|
+
})();
|