wickes-css2 2.103.0-0.5.0-icons.3 → 2.103.0-0.5.0-icons.6

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.
@@ -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
- if (className === '.energy-efficiency') {
48
- let isEnergyQueryEmpty = isClassPresentInQuery(currentQuery, "energy-efficiency--empty");
49
-
50
- if (isEnergyQueryEmpty) {
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.ProductBanner.checkProductsInColumn();
46
+ Wick.BannerPlacementManager.checkProductsInColumn();
47
47
  $(window).trigger('productBannerPositionChanged');
48
48
  Wick.EnergyEfficiency.drawEnergyLabels();
49
49
  Wick.PLP?.bindEvents();
@@ -1,4 +1,4 @@
1
- {{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page category-seo-config" title="Products list" globalSearchV2="true" pagePlp=true}}
1
+ {{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page retail-media 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}}
@@ -33,13 +33,23 @@
33
33
  </div>
34
34
 
35
35
  <div class="products-list products-list-v2">
36
- {{#each plp_load-more.results}}
37
- {{>card_product_v2}}
36
+ {{#each search-result_v2.products}}
37
+ {{>card_product_v2}}
38
38
  {{/each}}
39
39
  {{#if search-result_v2.product-banner}}
40
- {{#each search-result_v2.product-banner}}
41
- {{>card_product_banner_v2}}
42
- {{/each}}
40
+ {{#each search-result_v2.product-banner}}
41
+ {{>card_product_banner_v2}}
42
+ {{/each}}
43
+ {{/if}}
44
+ {{#if search-result_v2.sponsor-banner}}
45
+ {{#each search-result_v2.sponsor-banner}}
46
+ {{>card_sponsor_banner}}
47
+ {{/each}}
48
+ {{/if}}
49
+ {{#if search-result_v2.sponsor-product}}
50
+ {{#each search-result_v2.sponsor-product}}
51
+ {{>card_sponsor_product}}
52
+ {{/each}}
43
53
  {{/if}}
44
54
  </div>
45
55
  <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 plp_energy-efficiency.products}}
46
- {{> card_product_v2}}
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">
@@ -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
+ }
@@ -47,6 +47,17 @@ $color-bar-radius: 3px;
47
47
  }
48
48
  }
49
49
 
50
+ .sponsor-top-banner {
51
+ margin-bottom: 20px;
52
+ margin-top: 10px;
53
+
54
+ &__image {
55
+ display: block;
56
+ max-width: 100%;
57
+ margin-bottom: 20px;
58
+ }
59
+ }
60
+
50
61
  .color-pick {
51
62
  &__wrap {
52
63
  display: none;
@@ -37,6 +37,14 @@
37
37
  }
38
38
  }
39
39
  }
40
+
41
+ .sponsor-top-banner {
42
+ &__image {
43
+ margin-bottom: 20px;
44
+ display: block;
45
+ max-width: 100%;
46
+ }
47
+ }
40
48
  }
41
49
 
42
50
  .products-list {
@@ -1,148 +0,0 @@
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
- })