wickes-css2 2.103.0-IC-976-pre-commit-lint.8 → 2.103.0-IC-976-pre-commit-lint.9
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/category-main.css +1 -1
- package/build/css/components/card-product-banner.css +1 -1
- 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/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 +0 -54
- package/build/js/merged-checkout.min.js +1 -1
- 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 -5
- package/src/components/card_product_v2.hbs +5 -10
- package/src/components/injected-content.hbs +1 -1
- package/src/components/srp-injected.hbs +3 -13
- package/src/data/data_search-results_v2.json +141 -56
- package/src/js/components/product-banner.js +148 -0
- package/src/js/page/plp-cards-v2.js +6 -15
- package/src/js/page/plp-load-more.js +1 -1
- package/src/page_plp_v2.html +7 -16
- package/src/page_search-results.html +2 -12
- package/src/scss/category-main.scss +1 -0
- package/src/scss/components/card-product-banner.scss +3 -91
- package/src/scss/helpers/_colors-semantic.scss +1 -1
- package/src/scss/helpers/_variables.scss +2 -0
- package/src/scss/pages/page_products-list-combined.scss +0 -11
- package/src/scss/pages/page_products-list.scss +0 -8
- package/src/scss/plp-main.scss +1 -0
- package/src/components/card_sponsor_banner.hbs +0 -8
- package/src/components/card_sponsor_product.hbs +0 -6
- package/src/js/components/banner-placement-manager.js +0 -258
- package/src/js/emulation/banner-placement-manager.js +0 -53
package/package.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wickes-css2",
|
|
3
|
-
"version": "2.103.0-IC-976-pre-commit-lint.
|
|
3
|
+
"version": "2.103.0-IC-976-pre-commit-lint.9",
|
|
4
4
|
"description": "CSS and JS and page templates in use by Wickes",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"lint:js": "eslint .",
|
|
8
7
|
"lint:fix": "sass-lint-auto-fix",
|
|
9
|
-
"build": "gulp build"
|
|
10
|
-
"prepare": "husky install"
|
|
8
|
+
"build": "gulp build"
|
|
11
9
|
},
|
|
12
10
|
"keywords": [
|
|
13
11
|
"css",
|
|
@@ -81,7 +79,6 @@
|
|
|
81
79
|
"hbsfy": "^2.8.1",
|
|
82
80
|
"helper": "0.0.13",
|
|
83
81
|
"highlight.js": "9.13.0",
|
|
84
|
-
"husky": "8",
|
|
85
82
|
"jquery": "^3.5.1",
|
|
86
83
|
"jquery.scrollbar": "^0.2.11",
|
|
87
84
|
"js-cookie": "^3.0.1",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
<div class="product-card__reviews product-card__reviews-v2">
|
|
20
20
|
<div class="product-rating product-rating-v2">
|
|
21
21
|
<div class="rating-bg">
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
23
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
24
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
25
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
26
|
+
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
27
27
|
|
|
28
28
|
<div class="rating-overlay" data-rating="{{#if review-rating}}{{review-rating}}{{else}}0{{/if}}">
|
|
29
29
|
<span class="star-overlay">
|
|
@@ -48,11 +48,6 @@
|
|
|
48
48
|
</div>
|
|
49
49
|
{{/if}}
|
|
50
50
|
</div>
|
|
51
|
-
{{#if isSponsor}}
|
|
52
|
-
<div class="product-card__sponsored">Sponsored</div>
|
|
53
|
-
{{else}}
|
|
54
|
-
<div class="product-card__sponsored product-card__sponsored--empty"> </div>
|
|
55
|
-
{{/if}}
|
|
56
51
|
{{#if switch-vat}}
|
|
57
52
|
<div class="including-vat product-card__price {{#if sale}} product-card__price_sale {{/if}} {{#if
|
|
58
53
|
recommended}}product-card__min-height{{/if}}">
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
<div class="srp-injected">
|
|
2
2
|
<div class="srp-injected__content clamped-text">
|
|
3
3
|
<p>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<span style="font-weight:400">
|
|
8
|
-
<span style="font-style:normal">
|
|
9
|
-
<span style="text-decoration:none">
|
|
10
|
-
The right lighting can turn your bathroom into a sanctuary, blending style and practicality. From sleek ceiling lights to illuminated and elegant wall fixtures, each of our options is designed to elevate your space. Create a warm, inviting glow that turns your bathroom into a haven of comfort and style.
|
|
11
|
-
</span>
|
|
12
|
-
</span>
|
|
13
|
-
</span>
|
|
14
|
-
</span>
|
|
15
|
-
</span>
|
|
16
|
-
</span>
|
|
4
|
+
The right lighting can turn your bathroom into a sanctuary, blending style and practicality. From sleek ceiling
|
|
5
|
+
lights to illuminated and elegant wall fixtures, each of our options is designed to elevate your space. Create a
|
|
6
|
+
warm, inviting glow that turns your bathroom into a haven of comfort and style.
|
|
17
7
|
</p>
|
|
18
8
|
</div>
|
|
19
9
|
</div>
|
|
@@ -4,70 +4,25 @@
|
|
|
4
4
|
{
|
|
5
5
|
"src": "https://eu-images.contentstack.com/v3/assets/blt066259863543a0d2/bltf2fa907eeef56dc5/62161f9af3bcce42fe002786/PLP-DecoratingTools-230222.jpg",
|
|
6
6
|
"href": "/sitemap.html",
|
|
7
|
-
"desktop-position":
|
|
8
|
-
"mobile-position":
|
|
7
|
+
"desktop-position": 3,
|
|
8
|
+
"mobile-position": 2,
|
|
9
9
|
"show": false
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"sponsor-product": [
|
|
13
|
-
{
|
|
14
|
-
"isSponsor": true,
|
|
15
|
-
"desktop-position": 4,
|
|
16
|
-
"mobile-position": 3,
|
|
17
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
18
|
-
"code": "492747",
|
|
19
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
20
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
21
|
-
"reviews": "0",
|
|
22
|
-
"review-rating": "4.3",
|
|
23
|
-
"price": "<span class='product-card__price-value-text'>From</span> £99,009.00",
|
|
24
|
-
"perSQM": "£1,444.00",
|
|
25
|
-
"recommended": false,
|
|
26
|
-
"badge-text": "new",
|
|
27
|
-
"badge-color": "green",
|
|
28
|
-
"badge-text-color": "gray"
|
|
29
10
|
},
|
|
30
11
|
{
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"mobile-position": 4,
|
|
34
|
-
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
35
|
-
"code": "492747",
|
|
36
|
-
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
37
|
-
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
38
|
-
"reviews": "0",
|
|
39
|
-
"review-rating": "4.3",
|
|
40
|
-
"price": "<span class='product-card__price-value-text'>From</span> £99,009.00",
|
|
41
|
-
"perSQM": "£1,444.00",
|
|
42
|
-
"recommended": false,
|
|
43
|
-
"badge-text": "new",
|
|
44
|
-
"badge-color": "green",
|
|
45
|
-
"badge-text-color": "gray"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"isSponsor": true,
|
|
12
|
+
"src": "https://eu-images.contentstack.com/v3/assets/blt066259863543a0d2/bltf2fa907eeef56dc5/62161f9af3bcce42fe002786/PLP-DecoratingTools-230222.jpg",
|
|
13
|
+
"href": "/sitemap.html",
|
|
49
14
|
"desktop-position": 7,
|
|
50
15
|
"mobile-position": 5,
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
"reviews": "21",
|
|
56
|
-
"review-rating": "4.4",
|
|
57
|
-
"price": "£2,009.00",
|
|
58
|
-
"SQM": "£1,555.00",
|
|
59
|
-
"click-collect-only": true,
|
|
60
|
-
"badge-text": "Clearance",
|
|
61
|
-
"badge-color": "yellow",
|
|
62
|
-
"badge-text-color": "white"
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
"sponsor-banner": [
|
|
16
|
+
"required-amount-desktop": 6,
|
|
17
|
+
"required-amount-mobile": 4,
|
|
18
|
+
"show": false
|
|
19
|
+
},
|
|
66
20
|
{
|
|
67
21
|
"src": "https://eu-images.contentstack.com/v3/assets/blt066259863543a0d2/bltf2fa907eeef56dc5/62161f9af3bcce42fe002786/PLP-DecoratingTools-230222.jpg",
|
|
68
22
|
"href": "/sitemap.html",
|
|
69
|
-
"desktop
|
|
70
|
-
"mobile
|
|
23
|
+
"required-amount-desktop": 11,
|
|
24
|
+
"required-amount-mobile": 9,
|
|
25
|
+
"show": false
|
|
71
26
|
}
|
|
72
27
|
],
|
|
73
28
|
"products": [
|
|
@@ -241,6 +196,136 @@
|
|
|
241
196
|
"recommended": false,
|
|
242
197
|
"new": true,
|
|
243
198
|
"new-range": true
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
202
|
+
"code": "737934",
|
|
203
|
+
"src": "./img/placeholders/map-2.png",
|
|
204
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
205
|
+
"reviews": "0",
|
|
206
|
+
"price": "£2,009.00",
|
|
207
|
+
"recommended": false
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker - Black with Chrome Trim ",
|
|
211
|
+
"code": "247767",
|
|
212
|
+
"src": "./img/placeholders/map-2.png",
|
|
213
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
214
|
+
"reviews": "0",
|
|
215
|
+
"price": "£2,009.00",
|
|
216
|
+
"recommended": false
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
220
|
+
"code": "978004",
|
|
221
|
+
"src": "./img/placeholders/map-2.png",
|
|
222
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
223
|
+
"reviews": "0",
|
|
224
|
+
"price": "£2,009.00",
|
|
225
|
+
"recommended": false
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
229
|
+
"code": "523586",
|
|
230
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
231
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
232
|
+
"reviews": "0",
|
|
233
|
+
"perSQM": "£1,444.00",
|
|
234
|
+
"recommended": false
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
238
|
+
"code": "729112",
|
|
239
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
240
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
241
|
+
"reviews": "0",
|
|
242
|
+
"price": "£2,315.00",
|
|
243
|
+
"recommended": false
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"sale": {
|
|
247
|
+
"discount": "15% off",
|
|
248
|
+
"price": "£2,315.00"
|
|
249
|
+
},
|
|
250
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
251
|
+
"code": "279966",
|
|
252
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
253
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
254
|
+
"reviews": "0",
|
|
255
|
+
|
|
256
|
+
"recommended": false
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
260
|
+
"code": "813053",
|
|
261
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
262
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
263
|
+
"reviews": "0",
|
|
264
|
+
"SQM": "£1,555.00",
|
|
265
|
+
"recommended": false
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
269
|
+
"code": "655972",
|
|
270
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
271
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
272
|
+
"reviews": "0",
|
|
273
|
+
|
|
274
|
+
"recommended": false
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
278
|
+
"code": "757775",
|
|
279
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
280
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
281
|
+
"reviews": "0",
|
|
282
|
+
|
|
283
|
+
"recommended": false
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
287
|
+
"code": "276523",
|
|
288
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
289
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
290
|
+
"reviews": "0",
|
|
291
|
+
|
|
292
|
+
"recommended": false
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
296
|
+
"code": "334333",
|
|
297
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
298
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
299
|
+
"reviews": "0",
|
|
300
|
+
|
|
301
|
+
"recommended": false
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
305
|
+
"code": "597258",
|
|
306
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Alder-Trainer-7~GPID_1100568095_00",
|
|
307
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
308
|
+
"reviews": "0",
|
|
309
|
+
|
|
310
|
+
"recommended": false
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
314
|
+
"code": "806538",
|
|
315
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
316
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
317
|
+
"reviews": "0",
|
|
318
|
+
"perSQM": "£1,444.00",
|
|
319
|
+
"recommended": false
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
|
|
323
|
+
"code": "276521",
|
|
324
|
+
"src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
|
|
325
|
+
"descr": "Offer is valid for the same product and size in a single purchase",
|
|
326
|
+
"reviews": "0",
|
|
327
|
+
|
|
328
|
+
"recommended": false
|
|
244
329
|
}
|
|
245
330
|
]
|
|
246
331
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
Wick.ProductBanner = {
|
|
3
|
+
el: {
|
|
4
|
+
banners: '.card-product-banner',
|
|
5
|
+
bannerInactiveClass: 'card-product-banner--inactive',
|
|
6
|
+
productsWrap: '.products-list-v2',
|
|
7
|
+
$products: $('.product-card'),
|
|
8
|
+
attrPositionDesktop: 'data-desktop-position',
|
|
9
|
+
attrPositionMobile: 'data-mobile-position',
|
|
10
|
+
attrRequiredAmountDesktop: 'data-required-amount-desktop',
|
|
11
|
+
attrRequiredAmountMobile: 'data-required-amount-mobile',
|
|
12
|
+
hide: 'd-none'
|
|
13
|
+
},
|
|
14
|
+
currentBreakpoint: null,
|
|
15
|
+
checkProductsInColumn() {
|
|
16
|
+
Wick.ProductBanner.addInactiveClasses();
|
|
17
|
+
Wick.ProductBanner.arrangeBannersInRightOrder();
|
|
18
|
+
$(Wick.ProductBanner.el.banners).each((index, banner) => {
|
|
19
|
+
Wick.ProductBanner.hideBannerDueLimit(banner, index);
|
|
20
|
+
Wick.ProductBanner.moveBannerToSpecifiedPosition(banner);
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
moveBannerToSpecifiedPosition(banner) {
|
|
24
|
+
const $listSlots = Wick.ProductBanner.getListSlots();
|
|
25
|
+
const bannerPosition = Wick.ProductBanner.getBannerPosition(banner) - 2;
|
|
26
|
+
const listSlotsLength = $listSlots.length;
|
|
27
|
+
|
|
28
|
+
if(Wick.ProductBanner.isBannerVisible(banner)) {
|
|
29
|
+
if (bannerPosition <= listSlotsLength) {
|
|
30
|
+
if ($listSlots[bannerPosition]) {
|
|
31
|
+
Wick.ProductBanner.showBanner(banner);
|
|
32
|
+
Wick.ProductBanner.removeInactiveClass(banner);
|
|
33
|
+
Wick.ProductBanner.moveBanner(banner, $listSlots[bannerPosition]);
|
|
34
|
+
} else {
|
|
35
|
+
Wick.ProductBanner.hideBanner(banner);
|
|
36
|
+
Wick.ProductBanner.coverEdgeCases(banner);
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
Wick.ProductBanner.hideBanner(banner);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
moveBanner(banner, targetElement) {
|
|
44
|
+
$(banner).remove();
|
|
45
|
+
$(targetElement).after(banner);
|
|
46
|
+
},
|
|
47
|
+
hideBanner(banner) {
|
|
48
|
+
$(banner).addClass(Wick.ProductBanner.el.hide);
|
|
49
|
+
},
|
|
50
|
+
showBanner(banner) {
|
|
51
|
+
$(banner).removeClass(Wick.ProductBanner.el.hide);
|
|
52
|
+
},
|
|
53
|
+
isBannerVisible(banner) {
|
|
54
|
+
return !$(banner).hasClass(Wick.ProductBanner.el.hide);
|
|
55
|
+
},
|
|
56
|
+
hideBannerDueLimit(banner) {
|
|
57
|
+
const bannerMinLimit = Wick.ProductBanner.getBannerLimit(banner) - 1;
|
|
58
|
+
const $listSlots = Wick.ProductBanner.getListSlots();
|
|
59
|
+
const listProductsLength = $listSlots.length;
|
|
60
|
+
Wick.ProductBanner.showBanner(banner);
|
|
61
|
+
|
|
62
|
+
if (bannerMinLimit > listProductsLength) {
|
|
63
|
+
Wick.ProductBanner.hideBanner(banner);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
getBannerPosition(banner) {
|
|
67
|
+
const isMobile = Wick.ProductBanner.isMobileResolution();
|
|
68
|
+
const positionAttribute = isMobile
|
|
69
|
+
? Wick.ProductBanner.el.attrPositionMobile
|
|
70
|
+
: Wick.ProductBanner.el.attrPositionDesktop
|
|
71
|
+
|
|
72
|
+
return banner.hasAttribute(positionAttribute)
|
|
73
|
+
? Number(banner.getAttribute(positionAttribute))
|
|
74
|
+
: Number(Wick.ProductBanner.getListLength() + Wick.ProductBanner.getBannersAmount());
|
|
75
|
+
},
|
|
76
|
+
getBannerLimit(banner) {
|
|
77
|
+
const isMobile = Wick.ProductBanner.isMobileResolution();
|
|
78
|
+
|
|
79
|
+
const limitAttribute = isMobile
|
|
80
|
+
? Wick.ProductBanner.el.attrRequiredAmountMobile
|
|
81
|
+
: Wick.ProductBanner.el.attrRequiredAmountDesktop;
|
|
82
|
+
|
|
83
|
+
return banner.hasAttribute(limitAttribute)
|
|
84
|
+
? Number(banner.getAttribute(limitAttribute))
|
|
85
|
+
: 0;
|
|
86
|
+
},
|
|
87
|
+
isMobileResolution() {
|
|
88
|
+
return Wick.Responsive.getCurrentBreakpoint() !== 'up-lg';
|
|
89
|
+
},
|
|
90
|
+
getListLength() {
|
|
91
|
+
const $listItems = $(Wick.ProductBanner.el.productsWrap).find('.product-card');
|
|
92
|
+
return $listItems.length;
|
|
93
|
+
},
|
|
94
|
+
getBannersAmount() {
|
|
95
|
+
return $(Wick.ProductBanner.el.banners).length;
|
|
96
|
+
},
|
|
97
|
+
getProductsAmount() {
|
|
98
|
+
return Wick.ProductBanner.el.$products.length;
|
|
99
|
+
},
|
|
100
|
+
arrangeBannersInRightOrder() {
|
|
101
|
+
$(Wick.ProductBanner.el.banners).sort((a, b) => {
|
|
102
|
+
let bannerPositionA = Wick.ProductBanner.getBannerPosition(a);
|
|
103
|
+
let bannerPositionB = Wick.ProductBanner.getBannerPosition(b);
|
|
104
|
+
|
|
105
|
+
return bannerPositionA - bannerPositionB
|
|
106
|
+
}).appendTo(Wick.ProductBanner.el.productsWrap);
|
|
107
|
+
},
|
|
108
|
+
addInactiveClasses() {
|
|
109
|
+
$(Wick.ProductBanner.el.banners).addClass(Wick.ProductBanner.el.bannerInactiveClass);
|
|
110
|
+
},
|
|
111
|
+
removeInactiveClass(banner) {
|
|
112
|
+
$(banner).removeClass(Wick.ProductBanner.el.bannerInactiveClass)
|
|
113
|
+
},
|
|
114
|
+
insertFirstBanner(banner) {
|
|
115
|
+
const bannerPosition = Wick.ProductBanner.getBannerPosition(banner);
|
|
116
|
+
|
|
117
|
+
if (bannerPosition === 1) {
|
|
118
|
+
Wick.ProductBanner.showBanner(banner);
|
|
119
|
+
Wick.ProductBanner.removeInactiveClass(banner);
|
|
120
|
+
$(banner).remove();
|
|
121
|
+
$(Wick.ProductBanner.el.productsWrap).prepend(banner);
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
coverEdgeCases(banner) {
|
|
125
|
+
Wick.ProductBanner.insertFirstBanner(banner);
|
|
126
|
+
},
|
|
127
|
+
getListSlots() {
|
|
128
|
+
return $(Wick.ProductBanner.el.productsWrap)
|
|
129
|
+
.find('.product-card, .card-product-banner:not(.card-product-banner--inactive)');
|
|
130
|
+
},
|
|
131
|
+
init() {
|
|
132
|
+
Wick.Responsive.onResize(function () {
|
|
133
|
+
if(Wick.ProductBanner.currentBreakpoint !== Wick.Responsive.getCurrentBreakpoint()) {
|
|
134
|
+
Wick.ProductBanner.currentBreakpoint = Wick.Responsive.getCurrentBreakpoint()
|
|
135
|
+
Wick.ProductBanner.checkProductsInColumn();
|
|
136
|
+
$(window).trigger('productBannerPositionChanged');
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
$(document).ready(function () {
|
|
143
|
+
if (!Wick.ProductBanner.getBannersAmount() || !Wick.ProductBanner.getProductsAmount()) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
Wick.ProductBanner.init();
|
|
148
|
+
})
|
|
@@ -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();
|
package/src/page_plp_v2.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page
|
|
1
|
+
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page category-seo-config" 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}}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
<h1 class="page-header__title">
|
|
11
11
|
Fire Doors
|
|
12
12
|
</h1>
|
|
13
|
+
{{> srp-injected}}
|
|
13
14
|
</div>
|
|
14
15
|
|
|
15
16
|
{{> color-picker-plp }}
|
|
@@ -32,23 +33,13 @@
|
|
|
32
33
|
</div>
|
|
33
34
|
|
|
34
35
|
<div class="products-list products-list-v2">
|
|
35
|
-
{{#each
|
|
36
|
-
|
|
36
|
+
{{#each plp_load-more.results}}
|
|
37
|
+
{{>card_product_v2}}
|
|
37
38
|
{{/each}}
|
|
38
39
|
{{#if search-result_v2.product-banner}}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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}}
|
|
40
|
+
{{#each search-result_v2.product-banner}}
|
|
41
|
+
{{>card_product_banner_v2}}
|
|
42
|
+
{{/each}}
|
|
52
43
|
{{/if}}
|
|
53
44
|
</div>
|
|
54
45
|
<div class="load-more-wrap">
|
|
@@ -42,19 +42,9 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<div class="products-list products-list-v2">
|
|
45
|
-
{{#each
|
|
46
|
-
{{>card_product_v2}}
|
|
45
|
+
{{#each plp_energy-efficiency.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}}
|
|
58
48
|
</div>
|
|
59
49
|
|
|
60
50
|
<div class="sort-products-list">
|