wickes-css2 2.107.0-develop.2 → 2.107.0-develop.4
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 -1
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/my-account-main-v2.css +1 -1
- package/build/css/pages/my-account-v2.css +1 -1
- package/build/js/emulation.min.js +27 -1
- package/build/js/gift-cards.min.js +1 -1
- package/build/js/page/checkout-payment-details.js +96 -9
- package/build/js/page/checkout.js +1 -1
- package/build/js/page/components/gift-cards.js +1 -1
- package/build/js/page/kitchen/card-carousel.js +22 -22
- package/package.json +1 -1
- package/src/components/cart-voucher.hbs +10 -1
- package/src/components/checkout-payment-details-v2.hbs +4 -4
- package/src/components/checkout-payment-info-block.hbs +1 -1
- package/src/components/checkout_order-summary-new.hbs +1 -1
- package/src/components/order-item.hbs +18 -5
- package/src/components/order-summary.hbs +1 -1
- package/src/components/potential-promotion.hbs +12 -3
- package/src/data/data_shopping-cart-v2.json +23 -5
- package/src/js/emulation/checkout-payment-details.js +34 -1
- package/src/js/page/checkout-payment-details.js +96 -9
- package/src/js/page/checkout.js +1 -1
- package/src/js/page/components/gift-cards.js +1 -1
- package/src/js/page/kitchen/card-carousel.js +22 -22
- package/src/page_my-account-installer-carousel.html +131 -0
- package/src/page_shopping-cart-v2-vat.html +2 -1
- package/src/scss/components/checkout-chip.scss +1 -0
- package/src/scss/components/checkout-payment-details-v2.scss +12 -0
- package/src/scss/components/my-account/_clipboard-code.scss +4 -0
- package/src/sitemap.html +1 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
|
+
window.INIT_KLARNA_PAYMENT = window.INIT_KLARNA_PAYMENT || 'INIT_KLARNA_PAYMENT';
|
|
3
|
+
window.INIT_BILLIE_PAYMENT = window.INIT_BILLIE_PAYMENT || 'INIT_BILLIE_PAYMENT';
|
|
2
4
|
Wick.CheckoutPaymentDetails = (function () {
|
|
3
5
|
const $modal = $('#modal-terms-and-conditions');
|
|
4
6
|
|
|
@@ -10,9 +12,11 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
10
12
|
buttonName: 'btn-enter-details',
|
|
11
13
|
};
|
|
12
14
|
|
|
15
|
+
const toggleBillieRepaymentTermsClass = 'js-billie-repayment-terms--has-selection';
|
|
16
|
+
|
|
13
17
|
const elements = {
|
|
14
18
|
$billieRepaymentTerms: $('.js-billie-repayment-terms'),
|
|
15
|
-
$
|
|
19
|
+
$billieWidget: $('.checkout-payment-details__billie[data-billie]'),
|
|
16
20
|
$wrapperPaymentInput: $('.checkout-payment-details__row'),
|
|
17
21
|
paymentInputName: '[name=payment-method]',
|
|
18
22
|
$cardDetails: $('.checkout-payment-details__card-details'),
|
|
@@ -26,6 +30,52 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
26
30
|
hiddenClass: 'd-none',
|
|
27
31
|
};
|
|
28
32
|
|
|
33
|
+
let klarnaInited = false;
|
|
34
|
+
let billieInited = false;
|
|
35
|
+
|
|
36
|
+
function initKlarnaPayment() {
|
|
37
|
+
if (klarnaInited) return Promise.resolve({ ok: true, cached: true });
|
|
38
|
+
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const payload = {};
|
|
41
|
+
const detail = {
|
|
42
|
+
resolve: (data) => {
|
|
43
|
+
klarnaInited = true;
|
|
44
|
+
resolve(data);
|
|
45
|
+
},
|
|
46
|
+
reject,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const evt = createEvent(window.INIT_KLARNA_PAYMENT, payload, detail);
|
|
50
|
+
window.dispatchEvent(evt);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function initBilliePayment() {
|
|
55
|
+
if (billieInited) return Promise.resolve({ ok: true, cached: true });
|
|
56
|
+
|
|
57
|
+
return new Promise((resolve, reject) => {
|
|
58
|
+
const payload = {};
|
|
59
|
+
const detail = {
|
|
60
|
+
resolve: (data) => {
|
|
61
|
+
billieInited = true;
|
|
62
|
+
resolve(data);
|
|
63
|
+
},
|
|
64
|
+
reject,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const evt = createEvent(window.INIT_BILLIE_PAYMENT, payload, detail);
|
|
68
|
+
window.dispatchEvent(evt);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function getBillieRepaymentTermsLength() {
|
|
73
|
+
const billieRepaymentTerms =
|
|
74
|
+
(window.Wick && window.Wick?.BillieData?.billiePaymentTerms) || [];
|
|
75
|
+
|
|
76
|
+
return Array.isArray(billieRepaymentTerms) ? billieRepaymentTerms.length : 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
29
79
|
function preparePage() {
|
|
30
80
|
var modalOpened = $('.modal.show').length;
|
|
31
81
|
if (!modalOpened) return;
|
|
@@ -54,10 +104,14 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
54
104
|
|
|
55
105
|
function togglePaymentBlocks(paymentMethods, checkedMethod) {
|
|
56
106
|
paymentMethods.forEach((method) => {
|
|
57
|
-
$(`[data-${method}]`).
|
|
107
|
+
$(`[data-${method}]`).hide();
|
|
58
108
|
});
|
|
59
|
-
}
|
|
60
109
|
|
|
110
|
+
const $selected = $(`[data-${checkedMethod}]`);
|
|
111
|
+
if ($selected.length) {
|
|
112
|
+
$selected.show();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
61
115
|
function resetAllCheckoutForms(keepPaymentMethod) {
|
|
62
116
|
const $container = elements.$wrapperPaymentInput.closest('.checkout-payment-details');
|
|
63
117
|
if (!$container.length) return;
|
|
@@ -101,9 +155,18 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
101
155
|
$row.find(':input').prop('disabled', !isVisible);
|
|
102
156
|
}
|
|
103
157
|
|
|
158
|
+
function _syncBillieUI(isReady) {
|
|
159
|
+
elements.$billieWidget.toggle(isReady);
|
|
160
|
+
elements.$billieRepaymentTerms.toggleClass(toggleBillieRepaymentTermsClass, isReady);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function resetBillieUi() {
|
|
164
|
+
_syncBillieUI(false);
|
|
165
|
+
}
|
|
166
|
+
|
|
104
167
|
function setBillieStepVisibility(isReady) {
|
|
168
|
+
_syncBillieUI(isReady);
|
|
105
169
|
setBillingDetailsRowVisibility(isReady);
|
|
106
|
-
elements.$billieInfoBlock.toggle(isReady);
|
|
107
170
|
}
|
|
108
171
|
|
|
109
172
|
function resetBillieRepaymentSelection() {
|
|
@@ -129,13 +192,27 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
129
192
|
const isUnregistered = type === 'unregistered';
|
|
130
193
|
const isRegistered = type === 'registered';
|
|
131
194
|
|
|
132
|
-
elements.$unregisteredFields
|
|
133
|
-
|
|
195
|
+
elements.$unregisteredFields
|
|
196
|
+
.toggleClass(elements.hiddenClass, !isUnregistered)
|
|
197
|
+
.removeAttr('style');
|
|
198
|
+
elements.$registeredFields
|
|
199
|
+
.toggleClass(elements.hiddenClass, !isRegistered)
|
|
200
|
+
.removeAttr('style');
|
|
134
201
|
}
|
|
135
202
|
|
|
136
203
|
function changeDetailsBlock(checkedMethod) {
|
|
137
204
|
if (checkedMethod !== 'billie') {
|
|
205
|
+
resetBillieUi();
|
|
138
206
|
setBillingDetailsRowVisibility(true);
|
|
207
|
+
hideBillieBusiness();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (checkedMethod === 'klarna') {
|
|
211
|
+
initKlarnaPayment().catch(() => {});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (checkedMethod === 'billie' && getBillieRepaymentTermsLength() === 1) {
|
|
215
|
+
initBilliePayment().catch(() => {});
|
|
139
216
|
}
|
|
140
217
|
|
|
141
218
|
switch (checkedMethod) {
|
|
@@ -157,7 +234,7 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
157
234
|
};
|
|
158
235
|
changeLabelText(detailsLabel);
|
|
159
236
|
|
|
160
|
-
setBillieStepVisibility(
|
|
237
|
+
setBillieStepVisibility(getBillieRepaymentTermsLength() === 1);
|
|
161
238
|
resetBillieRepaymentSelection();
|
|
162
239
|
showBillieBusiness();
|
|
163
240
|
break;
|
|
@@ -173,13 +250,13 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
173
250
|
prevClearableMethod = checkedMethod;
|
|
174
251
|
break;
|
|
175
252
|
|
|
176
|
-
case 'apple':
|
|
253
|
+
case 'apple-pay':
|
|
177
254
|
hideCardDetails();
|
|
178
255
|
hidePlaceOrder();
|
|
179
256
|
hideBillingAddres();
|
|
180
257
|
break;
|
|
181
258
|
|
|
182
|
-
case 'google':
|
|
259
|
+
case 'google-pay':
|
|
183
260
|
hideCardDetails();
|
|
184
261
|
hidePlaceOrder();
|
|
185
262
|
hideBillingAddres();
|
|
@@ -239,6 +316,12 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
239
316
|
});
|
|
240
317
|
}
|
|
241
318
|
|
|
319
|
+
function forceReflow($element) {
|
|
320
|
+
if (!$element.length) return;
|
|
321
|
+
void $element[0].offsetHeight;
|
|
322
|
+
$(window).trigger('resize');
|
|
323
|
+
}
|
|
324
|
+
|
|
242
325
|
function init() {
|
|
243
326
|
const paymentMethods = getPaymentMethods();
|
|
244
327
|
initBillieBusinessTypeToggle();
|
|
@@ -248,6 +331,10 @@ Wick.CheckoutPaymentDetails = (function () {
|
|
|
248
331
|
const currentMethod = $(elements.paymentInputName + ':checked').val();
|
|
249
332
|
if (currentMethod !== 'billie') return;
|
|
250
333
|
|
|
334
|
+
requestAnimationFrame(() => {
|
|
335
|
+
forceReflow(elements.$billieWidget);
|
|
336
|
+
});
|
|
337
|
+
|
|
251
338
|
const hasSelection = $('input[name="repaymentTerms"]:checked').length > 0;
|
|
252
339
|
setBillieStepVisibility(hasSelection);
|
|
253
340
|
|
|
@@ -111,7 +111,7 @@ Wick.GiftCard = {
|
|
|
111
111
|
klarnaInfo: '.checkout-payment-details__klarna',
|
|
112
112
|
billingAddress: '.billing-address',
|
|
113
113
|
altPaymentRowsAttr:
|
|
114
|
-
'[data-apple],[data-google],[data-paypal],[data-klarna],[data-billie],[data-clearpay],[data-existing-card]',
|
|
114
|
+
'[data-apple-pay],[data-google-pay],[data-paypal],[data-klarna],[data-billie],[data-clearpay],[data-existing-card]',
|
|
115
115
|
hiddenCard: 'checkout-payment-details__card-details_hidden',
|
|
116
116
|
cardDetails: '.checkout-payment-details__card-details',
|
|
117
117
|
},
|
|
@@ -3,30 +3,30 @@ var Wick = Wick || {};
|
|
|
3
3
|
Wick.PLPCardSwiper = {};
|
|
4
4
|
|
|
5
5
|
$(document).ready(function () {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const SELECTORS = {
|
|
7
|
+
kitchenCard: '.kitchen-card',
|
|
8
|
+
swiperContainer: '.swiper-container-main',
|
|
9
|
+
nextButton: '.kitchen-card__next-btn',
|
|
10
|
+
prevButton: '.kitchen-card__prev-btn',
|
|
11
|
+
};
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
$(SELECTORS.kitchenCard).each(function (index, container) {
|
|
14
|
+
const $container = $(container);
|
|
15
|
+
const id = $container.data('id');
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const sliderElement = $container.find(SELECTORS.swiperContainer)[0];
|
|
18
|
+
const nextButtonElement = $container.find(SELECTORS.nextButton)[0];
|
|
19
|
+
const prevButtonElement = $container.find(SELECTORS.prevButton)[0];
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
const swiper = new Swiper(sliderElement, {
|
|
22
|
+
speed: 400,
|
|
23
|
+
navigation: {
|
|
24
|
+
nextEl: nextButtonElement,
|
|
25
|
+
prevEl: prevButtonElement,
|
|
26
|
+
},
|
|
27
|
+
simulateTouch: false,
|
|
28
|
+
});
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
Wick.PLPCardSwiper[id] = swiper;
|
|
31
|
+
});
|
|
32
32
|
});
|
package/package.json
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
<li>
|
|
2
|
-
{{
|
|
2
|
+
{{#ifCond switch-vat '&&' textExcVat}}
|
|
3
|
+
<span class="including-vat">
|
|
4
|
+
{{{text}}}
|
|
5
|
+
</span>
|
|
6
|
+
<span class="excluding-vat d-none">
|
|
7
|
+
{{{textExcVat}}}
|
|
8
|
+
</span>
|
|
9
|
+
{{else}}
|
|
10
|
+
{{{text}}}
|
|
11
|
+
{{/ifCond}}
|
|
3
12
|
{{#if isDeletable}}
|
|
4
13
|
<span class="icon checkout-widget__voucher-remove">
|
|
5
14
|
<span class="fas fa-times"></span>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
type="radio"
|
|
26
26
|
id="checkout-payment-details-apple"
|
|
27
27
|
name="payment-method"
|
|
28
|
-
value="apple">
|
|
28
|
+
value="apple-pay">
|
|
29
29
|
<ins></ins>
|
|
30
30
|
<div class="apple-logo">
|
|
31
31
|
<img src="img/apple-pay.svg" alt="apple pay">
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
type="radio"
|
|
45
45
|
id="checkout-payment-details-google"
|
|
46
46
|
name="payment-method"
|
|
47
|
-
value="google">
|
|
47
|
+
value="google-pay">
|
|
48
48
|
<ins></ins>
|
|
49
49
|
<div class="google-logo">
|
|
50
50
|
<img src="img/google-pay-mark.svg" alt="google pay">
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
</div>
|
|
135
135
|
</div>
|
|
136
136
|
|
|
137
|
-
<div data-apple class="form-row form-row__action form-row__save apple-wrap" style="display: none;">
|
|
137
|
+
<div data-apple-pay class="form-row form-row__action form-row__save apple-wrap" style="display: none;">
|
|
138
138
|
<div class="form-row__col-btn">
|
|
139
139
|
<apple-pay-button class="apple__button" buttonstyle="black" type="pay" locale="en-GB"></apple-pay-button>
|
|
140
140
|
</div>
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
</div>
|
|
147
147
|
</div>
|
|
148
148
|
|
|
149
|
-
<div data-google class="form-row form-row__action form-row__save google-wrap" style="display: none;">
|
|
149
|
+
<div data-google-pay class="form-row form-row__action form-row__save google-wrap" style="display: none;">
|
|
150
150
|
<div class="form-row__col-btn">
|
|
151
151
|
<div class="google__button" id="google-pay-btn">
|
|
152
152
|
<button type="button" aria-label="Pay with GPay" class="gpay-button black pay en"></button>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div {{#if dataAttr}}{{dataAttr}}{{/if}} class="{{blockClass}}" style="display: none;">
|
|
2
|
-
<div class="{{infoClass}}">
|
|
2
|
+
<div class="{{infoClass}}" style="display: none;">
|
|
3
3
|
<div class="{{infoClass}}__header">
|
|
4
4
|
<h4 class="{{infoClass}}__header_title">{{{heading}}}</h4>
|
|
5
5
|
<div class="{{infoClass}}__logo-img-big">
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</span>
|
|
35
35
|
<ul class="checkout-widget__details-hidden collapse" id="acheckout-widget-accordion-{{id}}">
|
|
36
36
|
{{#each discounts}}
|
|
37
|
-
{{> cart-voucher}}
|
|
37
|
+
{{> cart-voucher switch-vat=../switch-vat}}
|
|
38
38
|
{{/each}}
|
|
39
39
|
</ul>
|
|
40
40
|
<span class="checkout-widget__detail-value">£0.00</span>
|
|
@@ -37,11 +37,24 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
{{#if offers}}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
{{#ifCond switch-vat '&&' offersExcVat}}
|
|
41
|
+
<div class="order-item__offers including-vat">
|
|
42
|
+
{{#each offers}}
|
|
43
|
+
<div class="order-item__promo">{{this}}</div>
|
|
44
|
+
{{/each}}
|
|
45
|
+
</div>
|
|
46
|
+
<div class="order-item__offers excluding-vat d-none">
|
|
47
|
+
{{#each offersExcVat}}
|
|
48
|
+
<div class="order-item__promo">{{this}}</div>
|
|
49
|
+
{{/each}}
|
|
50
|
+
</div>
|
|
51
|
+
{{else}}
|
|
52
|
+
<div class="order-item__offers">
|
|
53
|
+
{{#each offers}}
|
|
54
|
+
<div class="order-item__promo">{{this}}</div>
|
|
55
|
+
{{/each}}
|
|
56
|
+
</div>
|
|
57
|
+
{{/ifCond}}
|
|
45
58
|
{{/if}}
|
|
46
59
|
</div>
|
|
47
60
|
<div class="order-item__cost">
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
</div>
|
|
48
48
|
{{/if}}
|
|
49
49
|
<div class="summary__aside">
|
|
50
|
-
{{> checkout_order-summary-new head=title mod=mod id=id}}
|
|
50
|
+
{{> checkout_order-summary-new head=title mod=mod id=id switch-vat=switch-vat}}
|
|
51
51
|
|
|
52
52
|
{{#if klarna-placement}}
|
|
53
53
|
<div class="summary__klarna">
|
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
<div class="p-promotion__icon">
|
|
3
3
|
<i class="icon fas fa-gift"></i>
|
|
4
4
|
</div>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
{{#ifCond switch-vat '&&' descriptionExcVat}}
|
|
6
|
+
<div class="p-promotion__description including-vat">
|
|
7
|
+
{{description}}
|
|
8
|
+
</div>
|
|
9
|
+
<div class="p-promotion__description excluding-vat d-none">
|
|
10
|
+
{{descriptionExcVat}}
|
|
11
|
+
</div>
|
|
12
|
+
{{else}}
|
|
13
|
+
<div class="p-promotion__description">
|
|
14
|
+
{{description}}
|
|
15
|
+
</div>
|
|
16
|
+
{{/ifCond}}
|
|
8
17
|
<div class="p-promotion__close">
|
|
9
18
|
<i class="icon fas fa-times"></i>
|
|
10
19
|
</div>
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
},
|
|
9
9
|
"potentialOrderPromotions": [
|
|
10
10
|
{
|
|
11
|
-
"description": "Spend over £200 on Bathroom Lighting and save £10.0"
|
|
11
|
+
"description": "Spend over £200 on Bathroom Lighting and save £10.0",
|
|
12
|
+
"descriptionExcVat": "Spend over £150 on Bathroom Lighting and save £10.0"
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
|
-
"description": "Spend over 2500 pound and get £2500 discount"
|
|
15
|
+
"description": "Spend over 2500 pound and get £2500 discount",
|
|
16
|
+
"descriptionExcVat": "Spend over 2000 pound and get £2000 discount"
|
|
15
17
|
}
|
|
16
18
|
],
|
|
17
19
|
"checkout": {
|
|
@@ -43,23 +45,28 @@
|
|
|
43
45
|
"discounts": [
|
|
44
46
|
{
|
|
45
47
|
"text": "Voucher abcd applies and giving 20% off",
|
|
48
|
+
"textExcVat": "Voucher abcd applies and giving 18% off",
|
|
46
49
|
"isDeletable": true
|
|
47
50
|
},
|
|
48
51
|
{
|
|
49
52
|
"text": "Voucher 20% off",
|
|
53
|
+
"textExcVat": "Voucher 18% off",
|
|
50
54
|
"isDeletable": true
|
|
51
55
|
},
|
|
52
56
|
{
|
|
53
|
-
"text": "Buy 4 for 3"
|
|
57
|
+
"text": "Buy 4 for 3",
|
|
58
|
+
"textExcVat": "Buy 5 for 3"
|
|
54
59
|
},
|
|
55
60
|
{
|
|
56
61
|
"text": "Online only offer"
|
|
57
62
|
},
|
|
58
63
|
{
|
|
59
|
-
"text": "2 for £35"
|
|
64
|
+
"text": "2 for £35",
|
|
65
|
+
"textExcVat": "2 for £30"
|
|
60
66
|
},
|
|
61
67
|
{
|
|
62
|
-
"text": "Offer price equivalent to £17.50 per item"
|
|
68
|
+
"text": "Offer price equivalent to £17.50 per item",
|
|
69
|
+
"textExcVat": "Offer price equivalent to £15.50 per item"
|
|
63
70
|
}
|
|
64
71
|
],
|
|
65
72
|
"total": {
|
|
@@ -86,6 +93,10 @@
|
|
|
86
93
|
"Buy 2 for 3 — Add 1 to qualify",
|
|
87
94
|
"Buy 2 for 3 — Add 1 to qualify"
|
|
88
95
|
],
|
|
96
|
+
"offersExcVat": [
|
|
97
|
+
"Buy 2 for 4 — Add 2 to qualify",
|
|
98
|
+
"Buy 2 for 4 — Add 2 to qualify"
|
|
99
|
+
],
|
|
89
100
|
"pricePerSQM": {
|
|
90
101
|
"value": "12"
|
|
91
102
|
},
|
|
@@ -1049,6 +1060,10 @@
|
|
|
1049
1060
|
"Buy 2 for 3 — Add 1 to qualify",
|
|
1050
1061
|
"Buy 2 for 3 — Add 1 to qualify"
|
|
1051
1062
|
],
|
|
1063
|
+
"offersExcVat": [
|
|
1064
|
+
"Buy 2 for 4 — Add 2 to qualify",
|
|
1065
|
+
"Buy 2 for 4 — Add 2 to qualify"
|
|
1066
|
+
],
|
|
1052
1067
|
"message": "Purchased 12 times since your last visit 1 day ago",
|
|
1053
1068
|
"infoTimeHead": "Available for Collection",
|
|
1054
1069
|
"address": "Watford",
|
|
@@ -1109,6 +1124,9 @@
|
|
|
1109
1124
|
"totalMobile": "16",
|
|
1110
1125
|
"offers": [
|
|
1111
1126
|
"Buy 2 Wickes Romano Bathroom Door Handle - Polished Chrome 1 Pair, Wickes Romano Locking Door Handle - Satin Nickel 1 Pair, Wickes Passage Door Knob Set - Brass 1 Pair for £8 - Add 1 to qualify"
|
|
1127
|
+
],
|
|
1128
|
+
"offersExcVat": [
|
|
1129
|
+
"Buy 2 Wickes Romano Bathroom Door Handle - Polished Chrome 1 Pair, Wickes Romano Locking Door Handle - Satin Nickel 1 Pair, Wickes Passage Door Knob Set - Brass 1 Pair for £7 - Add 1 to qualify"
|
|
1112
1130
|
]
|
|
1113
1131
|
},
|
|
1114
1132
|
{
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
window.Wick = window.Wick || {};
|
|
2
|
+
window.Wick.BillieData = window.Wick.BillieData || {};
|
|
3
|
+
window.Wick.BillieData.billiePaymentTerms = ['30', '60', '90'];
|
|
4
|
+
window.INIT_KLARNA_PAYMENT = window.INIT_KLARNA_PAYMENT || 'INIT_KLARNA_PAYMENT';
|
|
5
|
+
window.INIT_BILLIE_PAYMENT = window.INIT_BILLIE_PAYMENT || 'INIT_BILLIE_PAYMENT';
|
|
2
6
|
|
|
3
7
|
Wick.PaymentDetails = (function () {
|
|
4
8
|
var $btnEnterDetails = $('.btn-enter-details'),
|
|
5
9
|
isGuestPage = $('.page_checkout-payment-details_guest').length;
|
|
6
10
|
|
|
11
|
+
const $billieInfo = $('.checkout-payment-details__billie .billie-info');
|
|
12
|
+
const $klarnaInfo = $('.checkout-payment-details__klarna .klarna-info');
|
|
13
|
+
|
|
7
14
|
function bindEvents() {
|
|
8
15
|
$btnEnterDetails.on('click', function (e) {
|
|
9
16
|
e.preventDefault();
|
|
@@ -49,6 +56,32 @@ Wick.PaymentDetails = (function () {
|
|
|
49
56
|
Wick.Forms.showValidationErrors(this);
|
|
50
57
|
return false;
|
|
51
58
|
});
|
|
59
|
+
|
|
60
|
+
$(window).on(window.INIT_BILLIE_PAYMENT, function (e) {
|
|
61
|
+
const detail = e.detail || (e.originalEvent && e.originalEvent.detail) || {};
|
|
62
|
+
|
|
63
|
+
if (detail && detail.resolve) {
|
|
64
|
+
$billieInfo.show();
|
|
65
|
+
detail.resolve();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
$(window).on(window.INIT_KLARNA_PAYMENT, function (e) {
|
|
70
|
+
const detail = e.detail || (e.originalEvent && e.originalEvent.detail) || {};
|
|
71
|
+
|
|
72
|
+
if (detail && detail.resolve) {
|
|
73
|
+
$klarnaInfo.show();
|
|
74
|
+
detail.resolve();
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
$(document).on('change', 'input[name="repaymentTerms"]', function () {
|
|
79
|
+
const hasSelection = $('input[name="repaymentTerms"]:checked').length > 0;
|
|
80
|
+
|
|
81
|
+
if (hasSelection) {
|
|
82
|
+
$billieInfo.show();
|
|
83
|
+
}
|
|
84
|
+
});
|
|
52
85
|
}
|
|
53
86
|
|
|
54
87
|
bindEvents();
|