wickes-css2 2.103.0-RG-1587-replace-klarna-logo-with-svg-image.1 → 2.103.0-RG-1742-billie-30-60-90-days.2
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/Readme.md +1 -0
- package/build/css/components/card-product-banner.css +1 -1
- 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/main.css +1 -1
- package/build/css/pages/page_products-list-combined.css +1 -1
- package/build/css/pages/page_products-list.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/js/basket.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/emulation.min.js +164 -152
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/checkout-payment-details.js +96 -43
- package/build/js/page/plp-cards-v2.js +6 -15
- package/build/js/page/plp-load-more.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +2 -2
- package/src/components/card_product_v2.hbs +5 -10
- package/src/components/checkout-payment-details-v2.hbs +48 -30
- package/src/components/checkout-payment-repayment-terms.hbs +25 -0
- package/src/components/checkout_payment-new.hbs +4 -1
- package/src/components/checkout_payment-other-methods.hbs +4 -1
- package/src/components/injected-content.hbs +1 -1
- package/src/components/payments-checkout-v2.hbs +7 -2
- package/src/components/payments-checkout.hbs +6 -1
- package/src/components/payments.hbs +5 -1
- package/src/components/table_order-details-klarna.hbs +1 -1
- package/src/components/table_payment.hbs +4 -1
- package/src/data/data_search-results_v2.json +141 -56
- package/src/data/data_wismo.json +1 -1
- package/src/js/components/product-banner.js +148 -0
- package/src/js/emulation/checkout-payment-details.js +8 -8
- package/src/js/emulation/forms.js +118 -89
- 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/js/page/plp-cards-v2.js +6 -15
- package/src/js/page/plp-load-more.js +1 -1
- package/src/page_checkout_payment-details_guest-with-checkout-journey.html +1 -1
- package/src/page_my-order.html +1 -1
- package/src/page_payment-details-with-clearpay.html +2 -2
- package/src/page_plp_v2.html +6 -16
- package/src/page_search-results.html +2 -12
- package/src/page_shopping-cart-v2.html +2 -2
- package/src/page_split-orders-klarna.html +106 -0
- package/src/scss/components/card-product-banner.scss +3 -91
- package/src/scss/components/checkout-payment-details-v2.scss +1 -0
- package/src/scss/components/checkout-payment-repayment-terms.scss +104 -0
- package/src/scss/pages/page_products-list-combined.scss +0 -11
- package/src/scss/pages/page_products-list.scss +0 -8
- package/src/sitemap.html +6 -0
- package/build/img/klarna.svg +0 -10
- package/build/img/payment/checkout/klarna.svg +0 -10
- package/build/img/payment/footer/klarna.svg +0 -10
- package/src/components/card_sponsor_banner.hbs +0 -8
- package/src/components/card_sponsor_product.hbs +0 -6
- package/src/img/klarna.svg +0 -10
- package/src/img/payment/checkout/klarna.svg +0 -10
- package/src/img/payment/footer/klarna.svg +0 -10
- package/src/js/components/banner-placement-manager.js +0 -267
- package/src/js/emulation/banner-placement-manager.js +0 -53
|
@@ -8,6 +8,8 @@ Wick.CheckoutPaymentDetails = (function() {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const elements = {
|
|
11
|
+
$billieRepaymentTerms: $('.js-billie-repayment-terms'),
|
|
12
|
+
$billieInfoBlock: $('.checkout-payment-details__billie'),
|
|
11
13
|
$wrapperPaymentInput: $('.checkout-payment-details__row'),
|
|
12
14
|
paymentInputName: '[name=payment-method]',
|
|
13
15
|
$cardDetails: $('.checkout-payment-details__card-details'),
|
|
@@ -15,45 +17,81 @@ Wick.CheckoutPaymentDetails = (function() {
|
|
|
15
17
|
$billingAddress: $('.billing-address'),
|
|
16
18
|
hiddenCardDetailsClass: 'checkout-payment-details__card-details_hidden',
|
|
17
19
|
hiddenClass: 'd-none',
|
|
18
|
-
}
|
|
20
|
+
};
|
|
19
21
|
|
|
20
22
|
function preparePage() {
|
|
21
|
-
var modalOpened = $(
|
|
23
|
+
var modalOpened = $('.modal.show').length;
|
|
22
24
|
if (!modalOpened) {
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
25
27
|
var modalContent = $modal.find('.modal-content').clone();
|
|
26
|
-
$modal.modal(
|
|
27
|
-
modalContent.addClass(
|
|
28
|
-
$(
|
|
29
|
-
.addClass(
|
|
28
|
+
$modal.modal('hide');
|
|
29
|
+
modalContent.addClass('print-area');
|
|
30
|
+
$('body')
|
|
31
|
+
.addClass('print-mode')
|
|
30
32
|
.append(modalContent);
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
function resetPage() {
|
|
34
|
-
var modalPrintModeActive = $(
|
|
36
|
+
var modalPrintModeActive = $('body.print-mode').length;
|
|
35
37
|
if (!modalPrintModeActive) {
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
38
|
-
$(
|
|
39
|
-
$(
|
|
40
|
-
$modal.modal(
|
|
40
|
+
$('body').removeClass('print-mode');
|
|
41
|
+
$('.print-area').remove();
|
|
42
|
+
$modal.modal('show');
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
function getPaymentMethods() {
|
|
44
46
|
return $(elements.paymentInputName)
|
|
45
47
|
.map((_, item) => $(item).val())
|
|
46
|
-
.get()
|
|
48
|
+
.get();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function setBillieStepVisibility(isReady) {
|
|
52
|
+
setBillingDetailsRowVisibility(isReady);
|
|
53
|
+
|
|
54
|
+
elements.$billieInfoBlock.toggle(isReady);
|
|
47
55
|
}
|
|
48
56
|
|
|
49
57
|
function togglePaymentBlocks(paymentMethods, checkedMethod) {
|
|
50
58
|
paymentMethods.forEach(method => {
|
|
51
|
-
$(`[data-${method}]`).toggle(checkedMethod === method)
|
|
52
|
-
})
|
|
59
|
+
$(`[data-${method}]`).toggle(checkedMethod === method);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function setBillingDetailsRowVisibility(isVisible) {
|
|
64
|
+
const $row = elements.$billingAddress.find('.checkout-payment-details__row');
|
|
65
|
+
|
|
66
|
+
$row.toggle(isVisible);
|
|
67
|
+
|
|
68
|
+
$row.find(':input').prop('disabled', !isVisible);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
function resetBillieRepaymentSelection() {
|
|
73
|
+
elements.$billieRepaymentTerms.find('input[name="repaymentTerms"]').prop('checked', false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function bindBillieRepaymentGate() {
|
|
77
|
+
$(document).on('change', 'input[name="repaymentTerms"]', function() {
|
|
78
|
+
const currentMethod = $(elements.paymentInputName + ':checked').val();
|
|
79
|
+
if (currentMethod !== 'billie') return;
|
|
80
|
+
|
|
81
|
+
const hasSelection = $('input[name="repaymentTerms"]:checked').length > 0;
|
|
82
|
+
setBillingDetailsRowVisibility(hasSelection);
|
|
83
|
+
|
|
84
|
+
const $row = $(this).closest('.form-row[data-row-required]');
|
|
85
|
+
$row.removeClass('form-row_validation-error').find('.form-row__error').remove();
|
|
86
|
+
});
|
|
53
87
|
}
|
|
54
88
|
|
|
55
89
|
function changeDetailsBlock(checkedMethod) {
|
|
56
|
-
|
|
90
|
+
if (checkedMethod !== 'billie') {
|
|
91
|
+
setBillingDetailsRowVisibility(true);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
switch (checkedMethod) {
|
|
57
95
|
case 'paypal':
|
|
58
96
|
hideCardDetails();
|
|
59
97
|
showPlaceOrder();
|
|
@@ -66,42 +104,48 @@ Wick.CheckoutPaymentDetails = (function() {
|
|
|
66
104
|
detailsLabel = {
|
|
67
105
|
...detailsLabel,
|
|
68
106
|
labelText: 'Name on Billie account',
|
|
69
|
-
buttonText: 'Pay with Billie'
|
|
70
|
-
}
|
|
107
|
+
buttonText: 'Pay with Billie',
|
|
108
|
+
};
|
|
71
109
|
changeLabelText(detailsLabel);
|
|
110
|
+
|
|
111
|
+
setBillieStepVisibility(false);
|
|
112
|
+
|
|
113
|
+
resetBillieRepaymentSelection();
|
|
72
114
|
break;
|
|
115
|
+
|
|
116
|
+
|
|
73
117
|
case 'clearpay':
|
|
74
118
|
detailsLabel = {
|
|
75
119
|
...detailsLabel,
|
|
76
120
|
labelText: 'Name on Clearpay account',
|
|
77
|
-
buttonText: 'Pay with Clearpay'
|
|
78
|
-
}
|
|
121
|
+
buttonText: 'Pay with Clearpay',
|
|
122
|
+
};
|
|
79
123
|
prevClearableMethod === 'card' && clearInputFields();
|
|
80
124
|
changeLabelText(detailsLabel);
|
|
81
125
|
prevClearableMethod = checkedMethod;
|
|
82
126
|
break;
|
|
83
127
|
case 'apple':
|
|
84
|
-
hideCardDetails()
|
|
85
|
-
hidePlaceOrder()
|
|
86
|
-
hideBillingAddres()
|
|
128
|
+
hideCardDetails();
|
|
129
|
+
hidePlaceOrder();
|
|
130
|
+
hideBillingAddres();
|
|
87
131
|
break;
|
|
88
132
|
case 'google':
|
|
89
|
-
hideCardDetails()
|
|
90
|
-
hidePlaceOrder()
|
|
91
|
-
hideBillingAddres()
|
|
133
|
+
hideCardDetails();
|
|
134
|
+
hidePlaceOrder();
|
|
135
|
+
hideBillingAddres();
|
|
92
136
|
break;
|
|
93
137
|
case 'card':
|
|
94
138
|
detailsLabel = {
|
|
95
139
|
...detailsLabel,
|
|
96
140
|
labelText: 'Name on card',
|
|
97
|
-
buttonText: 'Enter card details'
|
|
98
|
-
}
|
|
141
|
+
buttonText: 'Enter card details',
|
|
142
|
+
};
|
|
99
143
|
prevClearableMethod === 'clearpay' && clearInputFields();
|
|
100
144
|
changeLabelText(detailsLabel);
|
|
101
145
|
prevClearableMethod = checkedMethod;
|
|
102
146
|
break;
|
|
103
147
|
default:
|
|
104
|
-
showPlaceOrder()
|
|
148
|
+
showPlaceOrder();
|
|
105
149
|
}
|
|
106
150
|
}
|
|
107
151
|
|
|
@@ -117,7 +161,7 @@ Wick.CheckoutPaymentDetails = (function() {
|
|
|
117
161
|
const { inputName, labelText, buttonName, buttonText } = params;
|
|
118
162
|
elements.$billingAddress.removeClass(elements.hiddenClass);
|
|
119
163
|
let labelElement = elements.$billingAddress.find('[for="' + inputName + '"]');
|
|
120
|
-
let buttonElement = elements.$billingAddress.find(
|
|
164
|
+
let buttonElement = elements.$billingAddress.find('.' + buttonName + ' .btn__text');
|
|
121
165
|
|
|
122
166
|
labelElement && labelElement.text(labelText);
|
|
123
167
|
buttonElement && buttonElement.text(buttonText);
|
|
@@ -138,11 +182,27 @@ Wick.CheckoutPaymentDetails = (function() {
|
|
|
138
182
|
function init() {
|
|
139
183
|
const paymentMethods = getPaymentMethods();
|
|
140
184
|
|
|
185
|
+
$(document).on('change', 'input[name="repaymentTerms"]', function() {
|
|
186
|
+
const currentMethod = $(elements.paymentInputName + ':checked').val();
|
|
187
|
+
if (currentMethod !== 'billie') return;
|
|
188
|
+
|
|
189
|
+
const hasSelection = $('input[name="repaymentTerms"]:checked').length > 0;
|
|
190
|
+
|
|
191
|
+
setBillieStepVisibility(hasSelection);
|
|
192
|
+
|
|
193
|
+
const $row = $(this).closest('.form-row[data-row-required]');
|
|
194
|
+
$row.removeClass('form-row_validation-error')
|
|
195
|
+
.find('.form-row__error').remove();
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
|
|
141
199
|
elements.$wrapperPaymentInput.on('change', elements.paymentInputName, function() {
|
|
142
|
-
const
|
|
200
|
+
const form = $(this).closest('form')[0];
|
|
201
|
+
form && Wick.Forms.clearValidationErrors(form);
|
|
143
202
|
|
|
144
|
-
|
|
145
|
-
|
|
203
|
+
const checkedMethod = $(this).val();
|
|
204
|
+
togglePaymentBlocks(paymentMethods, checkedMethod);
|
|
205
|
+
changeDetailsBlock(checkedMethod);
|
|
146
206
|
});
|
|
147
207
|
|
|
148
208
|
$('.btn-new-card').on('click', function() {
|
|
@@ -157,27 +217,20 @@ Wick.CheckoutPaymentDetails = (function() {
|
|
|
157
217
|
return false;
|
|
158
218
|
});
|
|
159
219
|
|
|
160
|
-
|
|
161
|
-
if (!$modal.length) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
220
|
+
if (!$modal.length) return;
|
|
164
221
|
|
|
165
|
-
if (typeof(window.onbeforeprint) !== 'undefined') {
|
|
166
|
-
// subscriptions for browsers
|
|
222
|
+
if (typeof (window.onbeforeprint) !== 'undefined') {
|
|
167
223
|
window.onbeforeprint = preparePage;
|
|
168
224
|
window.onafterprint = resetPage;
|
|
169
225
|
} else if (window.matchMedia) {
|
|
170
|
-
// subscriptions for iOS devices
|
|
171
226
|
var mediaQueryList = window.matchMedia('print');
|
|
172
227
|
mediaQueryList.addListener(function(mql) {
|
|
173
|
-
if (mql.matches)
|
|
174
|
-
|
|
175
|
-
} else {
|
|
176
|
-
resetPage();
|
|
177
|
-
}
|
|
228
|
+
if (mql.matches) preparePage();
|
|
229
|
+
else resetPage();
|
|
178
230
|
});
|
|
179
231
|
}
|
|
180
232
|
}
|
|
181
233
|
|
|
234
|
+
|
|
182
235
|
init();
|
|
183
236
|
})();
|
|
@@ -6,9 +6,7 @@ $(document).ready(function () {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
function cardsContent(itemsInRow) {
|
|
9
|
-
let card = $('.content .product-card, .content .card-product-banner
|
|
10
|
-
return $(this).parents('.product-card, .card-product-banner, .card-sponsor-banner, .card-sponsor-product').length === 0;
|
|
11
|
-
});
|
|
9
|
+
let card = $('.content .product-card, .content .card-product-banner');
|
|
12
10
|
let priceSelectors = [
|
|
13
11
|
'.including-vat .product-card__price__old-price',
|
|
14
12
|
'.excluding-vat .product-card__price__old-price',
|
|
@@ -19,7 +17,6 @@ $(document).ready(function () {
|
|
|
19
17
|
revealAll(card, ['.product-card__price__old-price',
|
|
20
18
|
'.product-card__price-sqm',
|
|
21
19
|
'.product-card__price-value',
|
|
22
|
-
'.product-card__sponsored',
|
|
23
20
|
'.energy-efficiency',
|
|
24
21
|
'.energy-efficiency__link']);
|
|
25
22
|
|
|
@@ -36,8 +33,6 @@ $(document).ready(function () {
|
|
|
36
33
|
hideEmptiness(currentRow, '.product-card__price-sqm');
|
|
37
34
|
}
|
|
38
35
|
hideEmptiness(currentRow, '.product-card__price-value');
|
|
39
|
-
hideEmptiness(currentRow, '.product-card__sponsored');
|
|
40
|
-
hideEmptiness(currentRow, '.product-card__price__old-price');
|
|
41
36
|
hideEmptiness(currentRow, '.energy-efficiency');
|
|
42
37
|
hideEmptiness(currentRow, '.energy-efficiency__link');
|
|
43
38
|
|
|
@@ -48,15 +43,11 @@ $(document).ready(function () {
|
|
|
48
43
|
function hideEmptiness(query, className) {
|
|
49
44
|
let currentQuery = query.find(className);
|
|
50
45
|
let rowContent = currentQuery.text();
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (classEmptyCheckMap[className]) {
|
|
58
|
-
let isClassEmpty = isClassPresentInQuery(currentQuery, classEmptyCheckMap[className]);
|
|
59
|
-
if (isClassEmpty) {
|
|
46
|
+
|
|
47
|
+
if (className === '.energy-efficiency') {
|
|
48
|
+
let isEnergyQueryEmpty = isClassPresentInQuery(currentQuery, "energy-efficiency--empty");
|
|
49
|
+
|
|
50
|
+
if (isEnergyQueryEmpty) {
|
|
60
51
|
currentQuery.hide();
|
|
61
52
|
}
|
|
62
53
|
return;
|
|
@@ -43,7 +43,7 @@ Wick.PLPLoadMore = {
|
|
|
43
43
|
.finally(() => {
|
|
44
44
|
hideLoader(Wick.PLPLoadMore.el.loader);
|
|
45
45
|
Wick.PLPLoadMore.el.$loadMoreBtn.blur();
|
|
46
|
-
Wick.
|
|
46
|
+
Wick.ProductBanner.checkProductsInColumn();
|
|
47
47
|
$(window).trigger('productBannerPositionChanged');
|
|
48
48
|
Wick.EnergyEfficiency.drawEnergyLabels();
|
|
49
49
|
Wick.PLP?.bindEvents();
|