wickes-css2 2.103.0-gift-cards.16 → 2.103.0-gift-cards.18
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 +0 -1
- package/build/css/components/card-product-banner.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/pages/page_product-details-v2.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-before-combine.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/pdp-main.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/img/klarna.svg +10 -0
- package/build/img/payment/checkout/klarna.svg +10 -0
- package/build/img/payment/footer/klarna.svg +10 -0
- 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 +54 -0
- package/build/js/gift-cards.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/components/gift-cards.js +3 -3
- package/build/js/page/plp-cards-v2.js +15 -6
- package/build/js/page/plp-load-more.js +1 -1
- package/build/js/page/utils/gift-cards-utils.js +15 -2
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +1 -1
- package/src/components/card_product_v2.hbs +10 -5
- package/src/components/card_sponsor_banner.hbs +8 -0
- package/src/components/card_sponsor_product.hbs +6 -0
- package/src/components/checkout-payment-details-v2.hbs +7 -9
- package/src/components/checkout_payment-new.hbs +1 -4
- package/src/components/checkout_payment-other-methods.hbs +1 -4
- package/src/components/injected-content.hbs +1 -1
- package/src/components/payments-checkout-v2.hbs +2 -7
- package/src/components/payments-checkout.hbs +1 -6
- package/src/components/payments.hbs +1 -5
- package/src/components/table_order-details-klarna.hbs +1 -1
- package/src/components/table_payment.hbs +1 -4
- package/src/data/data_search-results_v2.json +56 -141
- package/src/data/data_wismo.json +1 -1
- package/src/img/klarna.svg +10 -0
- package/src/img/payment/checkout/klarna.svg +10 -0
- package/src/img/payment/footer/klarna.svg +10 -0
- package/src/js/components/banner-placement-manager.js +267 -0
- package/src/js/emulation/banner-placement-manager.js +53 -0
- package/src/js/page/components/gift-cards.js +3 -3
- package/src/js/page/plp-cards-v2.js +15 -6
- package/src/js/page/plp-load-more.js +1 -1
- package/src/js/page/utils/gift-cards-utils.js +15 -2
- 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 +16 -6
- package/src/page_search-results.html +12 -2
- package/src/page_shopping-cart-v2.html +2 -2
- package/src/scss/components/card-product-banner.scss +91 -3
- package/src/scss/pages/page_product-details-v2.scss +4 -0
- package/src/scss/pages/page_products-list-combined.scss +11 -0
- package/src/scss/pages/page_products-list.scss +8 -0
- package/src/sitemap.html +0 -6
- package/src/js/components/product-banner.js +0 -148
- package/src/page_split-orders-klarna.html +0 -106
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
Wick.BannerPlacementManager = {
|
|
3
|
+
SPONSOR_BANNERS_DISPLAYED_EVENT: 'sponsorAdsDisplayedEvent',
|
|
4
|
+
el: {
|
|
5
|
+
banners: '.card-product-banner',
|
|
6
|
+
sponsorBanners: '.card-sponsor-banner',
|
|
7
|
+
sponsorProducts: '.card-sponsor-product',
|
|
8
|
+
allBanners: '.card-product-banner, .card-sponsor-banner, .card-sponsor-product',
|
|
9
|
+
productCard: '.product-card',
|
|
10
|
+
allListSlots: '.product-card, .card-product-banner, .card-sponsor-banner, .card-sponsor-product',
|
|
11
|
+
productsWrap: '.products-list-v2',
|
|
12
|
+
$products: $('.product-card'),
|
|
13
|
+
attrPositionDesktop: 'data-desktop-position',
|
|
14
|
+
attrPositionMobile: 'data-mobile-position',
|
|
15
|
+
attrRequiredAmountDesktop: 'data-required-amount-desktop',
|
|
16
|
+
attrRequiredAmountMobile: 'data-required-amount-mobile',
|
|
17
|
+
hide: 'd-none',
|
|
18
|
+
sponsoredAdvBanners: '.sponsored-ad'
|
|
19
|
+
},
|
|
20
|
+
classes: {
|
|
21
|
+
sponsorBanners: 'card-sponsor-banner',
|
|
22
|
+
sponsorProducts: 'card-sponsor-product',
|
|
23
|
+
productBanners: 'card-product-banner',
|
|
24
|
+
bannerInactiveClass: 'card-product-banner--inactive'
|
|
25
|
+
},
|
|
26
|
+
isEventSent: false,
|
|
27
|
+
currentBreakpoint: null,
|
|
28
|
+
checkProductsInColumn() {
|
|
29
|
+
Wick.BannerPlacementManager.addInactiveClasses();
|
|
30
|
+
Wick.BannerPlacementManager.arrangeBannersInRightOrder();
|
|
31
|
+
const $allBanners = $(Wick.BannerPlacementManager.el.allBanners);
|
|
32
|
+
const totalProducts = Wick.BannerPlacementManager.getListLength();
|
|
33
|
+
const totalSlots = totalProducts + $allBanners.length;
|
|
34
|
+
$allBanners.each((index, banner) => {
|
|
35
|
+
const bannerPosition = Wick.BannerPlacementManager.getBannerPosition(banner);
|
|
36
|
+
|
|
37
|
+
if ($(banner).hasClass('card-product-banner')) {
|
|
38
|
+
if (bannerPosition > totalSlots) {
|
|
39
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
40
|
+
$(Wick.BannerPlacementManager.el.productsWrap).append(banner);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners) || $(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)) {
|
|
46
|
+
if (bannerPosition > totalProducts) {
|
|
47
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
48
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
49
|
+
$(Wick.BannerPlacementManager.el.productsWrap).append(banner);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
Wick.BannerPlacementManager.hideBannerDueLimit(banner, index);
|
|
55
|
+
Wick.BannerPlacementManager.moveBannerToSpecifiedPosition(banner);
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
moveBannerToSpecifiedPosition(banner) {
|
|
59
|
+
const $listSlots = Wick.BannerPlacementManager.getListSlots();
|
|
60
|
+
const bannerPosition = Wick.BannerPlacementManager.getBannerPosition(banner) - 2;
|
|
61
|
+
const listSlotsLength = $listSlots.length;
|
|
62
|
+
|
|
63
|
+
if (Wick.BannerPlacementManager.isBannerVisible(banner)) {
|
|
64
|
+
if (bannerPosition <= listSlotsLength) {
|
|
65
|
+
if ($listSlots[bannerPosition]) {
|
|
66
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
67
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
68
|
+
Wick.BannerPlacementManager.moveBanner(banner, $listSlots[bannerPosition]);
|
|
69
|
+
} else {
|
|
70
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
71
|
+
Wick.BannerPlacementManager.coverEdgeCases(banner);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners) || $(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)) {
|
|
75
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
76
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
77
|
+
$(Wick.BannerPlacementManager.el.productsWrap).append(banner);
|
|
78
|
+
} else {
|
|
79
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
moveBanner(banner, targetElement) {
|
|
85
|
+
$(banner).remove();
|
|
86
|
+
$(targetElement).after(banner);
|
|
87
|
+
},
|
|
88
|
+
hideBanner(banner) {
|
|
89
|
+
$(banner).addClass(Wick.BannerPlacementManager.el.hide);
|
|
90
|
+
},
|
|
91
|
+
showBanner(banner) {
|
|
92
|
+
$(banner).removeClass(Wick.BannerPlacementManager.el.hide);
|
|
93
|
+
},
|
|
94
|
+
isBannerVisible(banner) {
|
|
95
|
+
return !$(banner).hasClass(Wick.BannerPlacementManager.el.hide);
|
|
96
|
+
},
|
|
97
|
+
hideBannerDueLimit(banner) {
|
|
98
|
+
const bannerMinLimit = Wick.BannerPlacementManager.getBannerLimit(banner) - 1;
|
|
99
|
+
const $listSlots = Wick.BannerPlacementManager.getListSlots();
|
|
100
|
+
const listProductsLength = $listSlots.length;
|
|
101
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
102
|
+
|
|
103
|
+
if (bannerMinLimit > listProductsLength) {
|
|
104
|
+
Wick.BannerPlacementManager.hideBanner(banner);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
getBannerPosition(banner) {
|
|
108
|
+
const isMobile = Wick.BannerPlacementManager.isMobileResolution();
|
|
109
|
+
const positionAttribute = isMobile
|
|
110
|
+
? Wick.BannerPlacementManager.el.attrPositionMobile
|
|
111
|
+
: Wick.BannerPlacementManager.el.attrPositionDesktop
|
|
112
|
+
|
|
113
|
+
return banner.hasAttribute(positionAttribute)
|
|
114
|
+
? Number(banner.getAttribute(positionAttribute))
|
|
115
|
+
: Number(Wick.BannerPlacementManager.getListLength() + Wick.BannerPlacementManager.getBannersAmount());
|
|
116
|
+
},
|
|
117
|
+
getBannerLimit(banner) {
|
|
118
|
+
const isMobile = Wick.BannerPlacementManager.isMobileResolution();
|
|
119
|
+
|
|
120
|
+
const limitAttribute = isMobile
|
|
121
|
+
? Wick.BannerPlacementManager.el.attrRequiredAmountMobile
|
|
122
|
+
: Wick.BannerPlacementManager.el.attrRequiredAmountDesktop;
|
|
123
|
+
|
|
124
|
+
return banner.hasAttribute(limitAttribute)
|
|
125
|
+
? Number(banner.getAttribute(limitAttribute))
|
|
126
|
+
: 0;
|
|
127
|
+
},
|
|
128
|
+
isMobileResolution() {
|
|
129
|
+
return Wick.Responsive.getCurrentBreakpoint() !== 'up-lg';
|
|
130
|
+
},
|
|
131
|
+
getListLength() {
|
|
132
|
+
const $listItems = $(Wick.BannerPlacementManager.el.productsWrap).children(Wick.BannerPlacementManager.el.productCard);
|
|
133
|
+
return $listItems.length;
|
|
134
|
+
},
|
|
135
|
+
getBannersAmount() {
|
|
136
|
+
return $(Wick.BannerPlacementManager.el.allBanners).length;
|
|
137
|
+
},
|
|
138
|
+
getProductsAmount() {
|
|
139
|
+
return Wick.BannerPlacementManager.el.$products.length;
|
|
140
|
+
},
|
|
141
|
+
arrangeBannersInRightOrder() {
|
|
142
|
+
const $allBanners = $(Wick.BannerPlacementManager.el.allBanners);
|
|
143
|
+
|
|
144
|
+
const sponsorProducts = $allBanners.filter((i, el) =>
|
|
145
|
+
$(el).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)
|
|
146
|
+
);
|
|
147
|
+
const sponsorBanners = $allBanners.filter((i, el) =>
|
|
148
|
+
$(el).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners)
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
const firstSponsorProductPos = sponsorProducts.length > 0
|
|
152
|
+
? Math.min(...sponsorProducts.map((i, el) => Wick.BannerPlacementManager.getBannerPosition(el)).get())
|
|
153
|
+
: Infinity;
|
|
154
|
+
const firstSponsorBannerPos = sponsorBanners.length > 0
|
|
155
|
+
? Math.min(...sponsorBanners.map((i, el) => Wick.BannerPlacementManager.getBannerPosition(el)).get())
|
|
156
|
+
: Infinity;
|
|
157
|
+
|
|
158
|
+
let groupOrder;
|
|
159
|
+
if (firstSponsorProductPos < firstSponsorBannerPos) {
|
|
160
|
+
groupOrder = [
|
|
161
|
+
Wick.BannerPlacementManager.classes.sponsorProducts,
|
|
162
|
+
Wick.BannerPlacementManager.classes.sponsorBanners,
|
|
163
|
+
Wick.BannerPlacementManager.classes.productBanners
|
|
164
|
+
];
|
|
165
|
+
} else {
|
|
166
|
+
groupOrder = [
|
|
167
|
+
Wick.BannerPlacementManager.classes.sponsorBanners,
|
|
168
|
+
Wick.BannerPlacementManager.classes.sponsorProducts,
|
|
169
|
+
Wick.BannerPlacementManager.classes.productBanners
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
$allBanners.sort((a, b) => {
|
|
174
|
+
function getGroupIndex(el) {
|
|
175
|
+
if ($(el).hasClass(groupOrder[0])) return 0;
|
|
176
|
+
if ($(el).hasClass(groupOrder[1])) return 1;
|
|
177
|
+
if ($(el).hasClass(groupOrder[2])) return 2;
|
|
178
|
+
return 3;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const groupA = getGroupIndex(a);
|
|
182
|
+
const groupB = getGroupIndex(b);
|
|
183
|
+
|
|
184
|
+
if (groupA !== groupB) {
|
|
185
|
+
return groupA - groupB;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const positionA = Wick.BannerPlacementManager.getBannerPosition(a);
|
|
189
|
+
const positionB = Wick.BannerPlacementManager.getBannerPosition(b);
|
|
190
|
+
|
|
191
|
+
return positionA - positionB;
|
|
192
|
+
}).appendTo(Wick.BannerPlacementManager.el.productsWrap);
|
|
193
|
+
},
|
|
194
|
+
addInactiveClasses() {
|
|
195
|
+
$(Wick.BannerPlacementManager.el.allBanners).addClass(Wick.BannerPlacementManager.el.hide);
|
|
196
|
+
},
|
|
197
|
+
removeInactiveClass(banner) {
|
|
198
|
+
$(banner).removeClass(Wick.BannerPlacementManager.classes.bannerInactiveClass)
|
|
199
|
+
},
|
|
200
|
+
insertFirstBanner(banner) {
|
|
201
|
+
const bannerPosition = Wick.BannerPlacementManager.getBannerPosition(banner);
|
|
202
|
+
|
|
203
|
+
if (bannerPosition === 1) {
|
|
204
|
+
Wick.BannerPlacementManager.showBanner(banner);
|
|
205
|
+
Wick.BannerPlacementManager.removeInactiveClass(banner);
|
|
206
|
+
$(banner).remove();
|
|
207
|
+
$(Wick.BannerPlacementManager.el.productsWrap).prepend(banner);
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
coverEdgeCases(banner) {
|
|
211
|
+
Wick.BannerPlacementManager.insertFirstBanner(banner);
|
|
212
|
+
},
|
|
213
|
+
getListSlots() {
|
|
214
|
+
return $(Wick.BannerPlacementManager.el.productsWrap)
|
|
215
|
+
.children(Wick.BannerPlacementManager.el.allListSlots)
|
|
216
|
+
.filter(function() {
|
|
217
|
+
if ($(this).hasClass(Wick.BannerPlacementManager.classes.productBanners)) {
|
|
218
|
+
const position = Wick.BannerPlacementManager.getBannerPosition(this);
|
|
219
|
+
const productsCount = Wick.BannerPlacementManager.getListLength();
|
|
220
|
+
return position <= productsCount;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return true;
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
getBannerPriority(banner) {
|
|
227
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorProducts)) {
|
|
228
|
+
return 1;
|
|
229
|
+
}
|
|
230
|
+
if ($(banner).hasClass(Wick.BannerPlacementManager.classes.sponsorBanners)) {
|
|
231
|
+
return 2;
|
|
232
|
+
}
|
|
233
|
+
return 3;
|
|
234
|
+
},
|
|
235
|
+
dispatchSponsorAdsDisplayedEvent() {
|
|
236
|
+
return new Promise((resolve, reject) => {
|
|
237
|
+
const eventDetail = { resolve, reject };
|
|
238
|
+
const sponsorAdsEvent = createEvent(Wick.BannerPlacementManager.SPONSOR_BANNERS_DISPLAYED_EVENT, { displayed: true }, eventDetail);
|
|
239
|
+
window.dispatchEvent(sponsorAdsEvent);
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
init() {
|
|
243
|
+
Wick.Responsive.onResize(function () {
|
|
244
|
+
if(Wick.BannerPlacementManager.currentBreakpoint !== Wick.Responsive.getCurrentBreakpoint()) {
|
|
245
|
+
Wick.BannerPlacementManager.currentBreakpoint = Wick.Responsive.getCurrentBreakpoint()
|
|
246
|
+
Wick.BannerPlacementManager.checkProductsInColumn();
|
|
247
|
+
|
|
248
|
+
if (
|
|
249
|
+
!Wick.BannerPlacementManager.isEventSent && $(Wick.BannerPlacementManager.el.sponsoredAdvBanners).length
|
|
250
|
+
) {
|
|
251
|
+
Wick.BannerPlacementManager.dispatchSponsorAdsDisplayedEvent();
|
|
252
|
+
Wick.BannerPlacementManager.isEventSent = true;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
$(window).trigger('productBannerPositionChanged');
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
$(document).ready(function () {
|
|
262
|
+
if (!Wick.BannerPlacementManager.getBannersAmount() || !Wick.BannerPlacementManager.getProductsAmount()) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
Wick.BannerPlacementManager.init();
|
|
267
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Simulate prompt for input
|
|
2
|
+
function getInputs() {
|
|
3
|
+
const productBannerPositions = prompt("Enter Product Banner Positions:", "2") || "";
|
|
4
|
+
const sponsorProductPositions = prompt("Enter Sponsor Product Positions (comma-separated):", "6,7,8") || "";
|
|
5
|
+
const sponsorBannerPositions = prompt("Enter Sponsor Banner Positions:", "10") || "";
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
productBannerPositions: productBannerPositions ? productBannerPositions.split(",").map(Number) : [],
|
|
9
|
+
sponsorProductPositions: sponsorProductPositions ? sponsorProductPositions.split(",").map(Number) : [],
|
|
10
|
+
sponsorBannerPositions: sponsorBannerPositions ? sponsorBannerPositions.split(",").map(Number) : [],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function getPositionAttr() {
|
|
15
|
+
const isMobile = Wick.BannerPlacementManager.isMobileResolution();
|
|
16
|
+
return isMobile
|
|
17
|
+
? 'data-mobile-position'
|
|
18
|
+
: 'data-desktop-position';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function updatePositions(inputs) {
|
|
22
|
+
const productBannerElements = document.querySelectorAll(".card-product-banner");
|
|
23
|
+
productBannerElements.forEach((el, index) => {
|
|
24
|
+
if (inputs.productBannerPositions[index] !== undefined) {
|
|
25
|
+
el.setAttribute(getPositionAttr(), inputs.productBannerPositions[index]);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const sponsorProductElements = document.querySelectorAll(".card-sponsor-product");
|
|
30
|
+
sponsorProductElements.forEach((el, index) => {
|
|
31
|
+
if (inputs.sponsorProductPositions[index] !== undefined) {
|
|
32
|
+
el.setAttribute(getPositionAttr(), inputs.sponsorProductPositions[index]);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const sponsorBannerElements = document.querySelectorAll(".card-sponsor-banner");
|
|
37
|
+
sponsorBannerElements.forEach((el, index) => {
|
|
38
|
+
if (inputs.sponsorBannerPositions[index] !== undefined) {
|
|
39
|
+
el.setAttribute(getPositionAttr(), inputs.sponsorBannerPositions[index]);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function init() {
|
|
45
|
+
const inputs = getInputs();
|
|
46
|
+
updatePositions(inputs);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
$(document).ready(function () {
|
|
50
|
+
if ($('.retail-media .products-list.products-list-v2').length) {
|
|
51
|
+
setTimeout(() => init(), 100)
|
|
52
|
+
}
|
|
53
|
+
});
|
|
@@ -694,11 +694,11 @@ Wick.GiftCard = {
|
|
|
694
694
|
self.renderGiftCardsFromList($root, error.giftCards);
|
|
695
695
|
}
|
|
696
696
|
|
|
697
|
-
const
|
|
697
|
+
const msg = (error.errorCode && PAY_MESSAGE_BY_CODE[error.errorCode]) || DEFAULT_ERROR_MESSAGE;
|
|
698
698
|
|
|
699
|
-
if (
|
|
699
|
+
if (msg) {
|
|
700
700
|
Wick.Notification.show({
|
|
701
|
-
text: linkifyClickHere(
|
|
701
|
+
text: linkifyClickHere(msg),
|
|
702
702
|
container: '.globalMessages .container',
|
|
703
703
|
type: 'error',
|
|
704
704
|
});
|
|
@@ -6,7 +6,9 @@ $(document).ready(function () {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
function cardsContent(itemsInRow) {
|
|
9
|
-
let card = $('.content .product-card, .content .card-product-banner')
|
|
9
|
+
let card = $('.content .product-card, .content .card-product-banner, .content .card-sponsor-banner, .content .card-sponsor-product').filter(function() {
|
|
10
|
+
return $(this).parents('.product-card, .card-product-banner, .card-sponsor-banner, .card-sponsor-product').length === 0;
|
|
11
|
+
});
|
|
10
12
|
let priceSelectors = [
|
|
11
13
|
'.including-vat .product-card__price__old-price',
|
|
12
14
|
'.excluding-vat .product-card__price__old-price',
|
|
@@ -17,6 +19,7 @@ $(document).ready(function () {
|
|
|
17
19
|
revealAll(card, ['.product-card__price__old-price',
|
|
18
20
|
'.product-card__price-sqm',
|
|
19
21
|
'.product-card__price-value',
|
|
22
|
+
'.product-card__sponsored',
|
|
20
23
|
'.energy-efficiency',
|
|
21
24
|
'.energy-efficiency__link']);
|
|
22
25
|
|
|
@@ -33,6 +36,8 @@ $(document).ready(function () {
|
|
|
33
36
|
hideEmptiness(currentRow, '.product-card__price-sqm');
|
|
34
37
|
}
|
|
35
38
|
hideEmptiness(currentRow, '.product-card__price-value');
|
|
39
|
+
hideEmptiness(currentRow, '.product-card__sponsored');
|
|
40
|
+
hideEmptiness(currentRow, '.product-card__price__old-price');
|
|
36
41
|
hideEmptiness(currentRow, '.energy-efficiency');
|
|
37
42
|
hideEmptiness(currentRow, '.energy-efficiency__link');
|
|
38
43
|
|
|
@@ -43,11 +48,15 @@ $(document).ready(function () {
|
|
|
43
48
|
function hideEmptiness(query, className) {
|
|
44
49
|
let currentQuery = query.find(className);
|
|
45
50
|
let rowContent = currentQuery.text();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const classEmptyCheckMap = {
|
|
52
|
+
'.energy-efficiency': 'energy-efficiency--empty',
|
|
53
|
+
'.product-card__sponsored': 'product-card__sponsored--empty',
|
|
54
|
+
'.product-card__price__old-price': 'product-card__price_empty'
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
if (classEmptyCheckMap[className]) {
|
|
58
|
+
let isClassEmpty = isClassPresentInQuery(currentQuery, classEmptyCheckMap[className]);
|
|
59
|
+
if (isClassEmpty) {
|
|
51
60
|
currentQuery.hide();
|
|
52
61
|
}
|
|
53
62
|
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.BannerPlacementManager.checkProductsInColumn();
|
|
47
47
|
$(window).trigger('productBannerPositionChanged');
|
|
48
48
|
Wick.EnergyEfficiency.drawEnergyLabels();
|
|
49
49
|
Wick.PLP?.bindEvents();
|
|
@@ -19,12 +19,15 @@ const CURRENCY_KEYS = new Set([
|
|
|
19
19
|
const GIFT_CARD_ALREADY_ADDED = 'GIFT_CARD_ALREADY_ADDED';
|
|
20
20
|
const PIS_REQUEST_TIMEOUT = 'PIS-REQUEST-TIMEOUT';
|
|
21
21
|
const PIS_INTEGRATION_ERROR = 'PIS-INTEGRATION-ERROR';
|
|
22
|
+
const PIS_INSUFFICIENT_AMOUNT = 'PIS-INSUFFICIENT-AMOUNT';
|
|
23
|
+
const PIS_PROCESSING_ERROR = 'PIS_PROCESSING_ERROR';
|
|
22
24
|
const HYBRIS_REQUEST_TIMEOUT = 'HYBRIS-REQUEST-TIMEOUT';
|
|
23
|
-
const HYBRIS_PIS_INTEGRATION_ERROR = 'HYBRIS-
|
|
25
|
+
const HYBRIS_PIS_INTEGRATION_ERROR = 'HYBRIS-PIS_INTEGRATION-ERROR';
|
|
26
|
+
const HYBRIS_PIS_CONNECTION_ERROR = 'HYBRIS-PIS_CONNECTION-ERROR';
|
|
24
27
|
const ZERO_BALANCE = 'ZERO_BALANCE'
|
|
25
28
|
|
|
26
29
|
export const DEFAULT_ERROR_MESSAGE =
|
|
27
|
-
'
|
|
30
|
+
'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.';
|
|
28
31
|
|
|
29
32
|
export const OK_CODE = 0;
|
|
30
33
|
|
|
@@ -39,8 +42,11 @@ export const MESSAGE_BY_CODE = {
|
|
|
39
42
|
[GIFT_CARD_ALREADY_ADDED]: 'Gift Card already added, please use a different card.',
|
|
40
43
|
[PIS_REQUEST_TIMEOUT]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
41
44
|
[PIS_INTEGRATION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
45
|
+
[PIS_INSUFFICIENT_AMOUNT]: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
|
|
46
|
+
[PIS_PROCESSING_ERROR]: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
|
|
42
47
|
[HYBRIS_REQUEST_TIMEOUT]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
43
48
|
[HYBRIS_PIS_INTEGRATION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
49
|
+
[HYBRIS_PIS_CONNECTION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
44
50
|
[ZERO_BALANCE]: 'Insufficient funds available, please try another Gift Card or alternate payment method.',
|
|
45
51
|
99: 'The entered Gift Card is invalid. For support click here.',
|
|
46
52
|
[-1]: 'Gift Card is unavailable at this time, please try later. For support click here.',
|
|
@@ -51,6 +57,13 @@ export const PAY_MESSAGE_BY_CODE = {
|
|
|
51
57
|
102: 'Unfortunately there was a problem with requesting your card details from the payment provider. Available funds on your Gift Card are unchanged.',
|
|
52
58
|
103: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
|
|
53
59
|
104: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
|
|
60
|
+
[PIS_REQUEST_TIMEOUT]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
61
|
+
[PIS_INTEGRATION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
62
|
+
[PIS_INSUFFICIENT_AMOUNT]: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
|
|
63
|
+
[PIS_PROCESSING_ERROR]: 'Unfortunately there was a problem placing your order with Gift Card(s). Please click here for support.',
|
|
64
|
+
[HYBRIS_REQUEST_TIMEOUT]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
65
|
+
[HYBRIS_PIS_INTEGRATION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
66
|
+
[HYBRIS_PIS_CONNECTION_ERROR]: 'Unable to use Gift Card at this time, please try later or click here for support.',
|
|
54
67
|
};
|
|
55
68
|
|
|
56
69
|
export const ADD_GIFT_CARD = 'addGiftCard';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
{{/content}}
|
|
10
10
|
|
|
11
11
|
{{#content "aside"}}
|
|
12
|
-
{{> order-summary delivery-address-v2.summary no-action=true id=1 basket-id=true}}
|
|
12
|
+
{{> order-summary delivery-address-v2.summary no-action=true id=1 basket-id=true paymentsCheckoutV2=true}}
|
|
13
13
|
{{/content}}
|
|
14
14
|
|
|
15
15
|
{{#content "main"}}
|
package/src/page_my-order.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#extend "checkout" pageClass="page_checkout-delivery-new page_checkout-confirmation-new page_checkout" title="Checkout - Payment details with Clear Pay" isAsideSticky="true" clearPayIcon=true}}
|
|
1
|
+
{{#extend "checkout" pageClass="page_checkout-delivery-new page_checkout-confirmation-new page_checkout" title="Checkout - Payment details with Clear Pay" isAsideSticky="true" clearPayIcon=true checkout=true}}
|
|
2
2
|
|
|
3
3
|
{{#content "head" mode="append"}}
|
|
4
4
|
<link type="text/css" rel="stylesheet" href="./css/pages/checkout-new.css">
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
{{/content}}
|
|
17
17
|
|
|
18
18
|
{{#content "aside"}}
|
|
19
|
-
{{> order-summary delivery-address-v2.summary no-action=true id=1 basket-id=true clearPayIcon=clearPayIcon}}
|
|
19
|
+
{{> order-summary delivery-address-v2.summary no-action=true id=1 basket-id=true clearPayIcon=clearPayIcon paymentsCheckoutV2=true checkout=true}}
|
|
20
20
|
{{/content}}
|
|
21
21
|
|
|
22
22
|
|
package/src/page_plp_v2.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page" title="Products list" globalSearchV2="true" pagePlp=true}}
|
|
1
|
+
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page retail-media" title="Products list" globalSearchV2="true" pagePlp=true}}
|
|
2
2
|
{{#content "head" mode="append" pagePlp=true}}
|
|
3
3
|
<link type="text/css" rel="stylesheet" href="./css/components/global-search.css">
|
|
4
4
|
{{/content}}
|
|
@@ -32,13 +32,23 @@
|
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<div class="products-list products-list-v2">
|
|
35
|
-
{{#each
|
|
36
|
-
|
|
35
|
+
{{#each search-result_v2.products}}
|
|
36
|
+
{{>card_product_v2}}
|
|
37
37
|
{{/each}}
|
|
38
38
|
{{#if search-result_v2.product-banner}}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
{{#each search-result_v2.product-banner}}
|
|
40
|
+
{{>card_product_banner_v2}}
|
|
41
|
+
{{/each}}
|
|
42
|
+
{{/if}}
|
|
43
|
+
{{#if search-result_v2.sponsor-banner}}
|
|
44
|
+
{{#each search-result_v2.sponsor-banner}}
|
|
45
|
+
{{>card_sponsor_banner}}
|
|
46
|
+
{{/each}}
|
|
47
|
+
{{/if}}
|
|
48
|
+
{{#if search-result_v2.sponsor-product}}
|
|
49
|
+
{{#each search-result_v2.sponsor-product}}
|
|
50
|
+
{{>card_sponsor_product}}
|
|
51
|
+
{{/each}}
|
|
42
52
|
{{/if}}
|
|
43
53
|
</div>
|
|
44
54
|
<div class="load-more-wrap">
|
|
@@ -42,9 +42,19 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<div class="products-list products-list-v2">
|
|
45
|
-
{{#each
|
|
46
|
-
{{>
|
|
45
|
+
{{#each search-result_v2.products}}
|
|
46
|
+
{{>card_product_v2}}
|
|
47
47
|
{{/each}}
|
|
48
|
+
{{#if search-result_v2.sponsor-banner}}
|
|
49
|
+
{{#each search-result_v2.sponsor-banner}}
|
|
50
|
+
{{>card_sponsor_banner}}
|
|
51
|
+
{{/each}}
|
|
52
|
+
{{/if}}
|
|
53
|
+
{{#if search-result_v2.sponsor-product}}
|
|
54
|
+
{{#each search-result_v2.sponsor-product}}
|
|
55
|
+
{{>card_sponsor_product}}
|
|
56
|
+
{{/each}}
|
|
57
|
+
{{/if}}
|
|
48
58
|
</div>
|
|
49
59
|
|
|
50
60
|
<div class="sort-products-list">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#extend "basket-new" page_shopping-cart pageClass="page_basket basket" title="Basket" billieIcon=
|
|
1
|
+
{{#extend "basket-new" page_shopping-cart pageClass="page_basket basket" title="Basket" billieIcon=false}}
|
|
2
2
|
{{#content "head" mode="append"}}
|
|
3
3
|
<link type="text/css" rel="stylesheet" href="./css/pages/page_shopping-cart-v2.css">
|
|
4
4
|
<link type="text/css" rel="stylesheet" href="./css/pages/checkout-new.css">
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}}
|
|
28
28
|
{{> checkout-action mod="mounted"}}
|
|
29
29
|
{{> checkout-action mod="mounted" view="mobile"}}
|
|
30
|
-
{{> summary-payment paymentsCheckoutV2=true billieIcon=
|
|
30
|
+
{{> summary-payment paymentsCheckoutV2=true billieIcon=false}}
|
|
31
31
|
{{/content}}
|
|
32
32
|
{{#content "main"}}
|
|
33
33
|
<input type="hidden" id="SUPPLIER_DELIVERED_7_DAYS" value="<b> Wickes Supplier </b> - Delivery within 7 days">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@include make-col(4);
|
|
5
5
|
margin-bottom: 30px;
|
|
6
6
|
|
|
7
|
-
@include media-breakpoint-down(md) {
|
|
7
|
+
@include media-breakpoint-down(md) {
|
|
8
8
|
@include make-col(6);
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
padding: 0 15px;
|
|
40
40
|
|
|
41
41
|
@include media-breakpoint-down(sm) {
|
|
42
|
-
display: inline-block;
|
|
42
|
+
display: inline-block;
|
|
43
43
|
padding: 0;
|
|
44
44
|
width: 100%;
|
|
45
45
|
}
|
|
@@ -49,4 +49,92 @@
|
|
|
49
49
|
display: inline-block;
|
|
50
50
|
width: 100%;
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.products-list {
|
|
55
|
+
.card-sponsor-product,
|
|
56
|
+
.card-sponsor-banner {
|
|
57
|
+
@include make-col(4);
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.card-sponsor-banner {
|
|
62
|
+
&__link {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
padding: 0 15px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&__image {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.card-sponsor-product {
|
|
76
|
+
.product-card {
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.product-card__sponsored {
|
|
82
|
+
@include font-size(12);
|
|
83
|
+
@include line-height(16);
|
|
84
|
+
color: $squant;
|
|
85
|
+
font-weight: 400;
|
|
86
|
+
margin-top: -3px;
|
|
87
|
+
margin-bottom: 15px;
|
|
88
|
+
padding: 2px 4px;
|
|
89
|
+
|
|
90
|
+
&:not(.product-card__sponsored--empty) {
|
|
91
|
+
width: max-content;
|
|
92
|
+
background: $gray-light;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@include media-breakpoint-down(md) {
|
|
98
|
+
.products-list {
|
|
99
|
+
.card-sponsor-product,
|
|
100
|
+
.card-sponsor-banner {
|
|
101
|
+
@include make-col(6);
|
|
102
|
+
|
|
103
|
+
.card {
|
|
104
|
+
max-width: 100%;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.products-list-v2 {
|
|
110
|
+
.card-sponsor-product:nth-of-type(n+3) {
|
|
111
|
+
.card {
|
|
112
|
+
&:before {
|
|
113
|
+
content: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@include media-breakpoint-down(sm) {
|
|
121
|
+
.products-list {
|
|
122
|
+
.product-card__sponsored {
|
|
123
|
+
margin-right: auto;
|
|
124
|
+
margin-left: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.card-sponsor-banner {
|
|
128
|
+
position: relative;
|
|
129
|
+
|
|
130
|
+
&::after {
|
|
131
|
+
content: '';
|
|
132
|
+
position: absolute;
|
|
133
|
+
bottom: 20px;
|
|
134
|
+
left: 5px;
|
|
135
|
+
width: calc(100% - 10px);
|
|
136
|
+
border-bottom: 1px solid $gray;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|