wickes-css2 2.102.0-lg-788-improve-mini-basket.6 → 2.103.0-gift-cards.1

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.
Files changed (114) hide show
  1. package/Readme.md +1 -3
  2. package/build/css/category-main.css +1 -1
  3. package/build/css/components/card-product-banner.css +1 -1
  4. package/build/css/components/checkout-payment-details-v2.css +1 -1
  5. package/build/css/homepage-main.css +1 -1
  6. package/build/css/kitchen-plp-main.css +1 -1
  7. package/build/css/main.css +1 -1
  8. package/build/css/my-account-main-v2.css +1 -1
  9. package/build/css/my-account-main.css +1 -1
  10. package/build/css/pages/my-account-v2.css +1 -1
  11. package/build/css/pages/page_checkout_delivery-new.css +1 -1
  12. package/build/css/pages/page_products-list-combined.css +1 -1
  13. package/build/css/pages/page_products-list.css +1 -1
  14. package/build/css/pdp-main-before-combine.css +1 -1
  15. package/build/css/pdp-main-non-critical.css +1 -1
  16. package/build/css/pdp-main.css +1 -1
  17. package/build/css/plp-main.css +1 -1
  18. package/build/css/store-locator-main.css +1 -1
  19. package/build/img/giftcard.svg +28 -0
  20. package/build/js/account-members.min.js +1 -1
  21. package/build/js/basket.min.js +2 -2
  22. package/build/js/bundle.min.js +1 -1
  23. package/build/js/checkout.min.js +2 -2
  24. package/build/js/emulation.min.js +76 -1024
  25. package/build/js/general.bundle.min.js +1 -1
  26. package/build/js/gift-cards.min.js +1 -0
  27. package/build/js/merged-checkout.min.js +2 -2
  28. package/build/js/page/basket-v2.js +244 -138
  29. package/build/js/page/components/discounts.js +6 -6
  30. package/build/js/page/components/gift-cards.js +610 -0
  31. package/build/js/page/components/toggle-password-visibility.js +22 -0
  32. package/build/js/page/plp-cards-v2.js +6 -15
  33. package/build/js/page/plp-load-more.js +1 -1
  34. package/build/js/page/utils/gift-cards-utils.js +43 -0
  35. package/build/js/page/utils/show-hide-input.js +28 -0
  36. package/build/js/pdp.bundle.min.js +1 -1
  37. package/build/js/plp.bundle.min.js +1 -1
  38. package/build/js/project-list.min.js +1 -1
  39. package/build/js/toggle-password-visibility.min.js +1 -0
  40. package/package.json +2 -2
  41. package/src/components/card_product_v2.hbs +5 -10
  42. package/src/components/checkout-payment-details-v2.hbs +2 -1
  43. package/src/components/gift-cards-hint.hbs +9 -0
  44. package/src/components/gift-cards.hbs +89 -0
  45. package/src/components/giftcard-chip.hbs +23 -0
  46. package/src/components/injected-content.hbs +1 -1
  47. package/src/components/mini-basket/mini-basket-empty.hbs +13 -3
  48. package/src/components/mini-basket/mini-basket.hbs +13 -32
  49. package/src/components/mini-basket/product-item.hbs +16 -37
  50. package/src/data/data_confirmation-summary.json +2 -4
  51. package/src/data/data_mini-basket.json +80 -4
  52. package/src/data/data_search-results_v2.json +141 -56
  53. package/src/data/my-account/data_my-account.json +6 -0
  54. package/src/elements/form-row.hbs +1 -1
  55. package/src/elements/input.hbs +31 -2
  56. package/src/img/giftcard.svg +28 -0
  57. package/src/js/components/general/cart-slider.js +0 -3
  58. package/src/js/components/general/create-popup-slider.js +1 -4
  59. package/src/js/components/general/mini-basket-slider.js +8 -0
  60. package/src/js/components/product-banner.js +148 -0
  61. package/src/js/emulation/checkout-data.js +35 -0
  62. package/src/js/emulation/checkout-payment-details.js +23 -14
  63. package/src/js/emulation/custom-slider-emulation.js +10 -4
  64. package/src/js/emulation/forms.js +7 -2
  65. package/src/js/page/basket-v2.js +244 -138
  66. package/src/js/page/components/discounts.js +6 -6
  67. package/src/js/page/components/gift-cards.js +610 -0
  68. package/src/js/page/components/toggle-password-visibility.js +22 -0
  69. package/src/js/page/plp-cards-v2.js +6 -15
  70. package/src/js/page/plp-load-more.js +1 -1
  71. package/src/js/page/utils/gift-cards-utils.js +43 -0
  72. package/src/js/page/utils/show-hide-input.js +28 -0
  73. package/src/layouts/base.hbs +6 -0
  74. package/src/page_my-account_change-password.html +1 -0
  75. package/src/page_payment-details-with-gift-card.html +2 -1
  76. package/src/page_plp_v2.html +6 -16
  77. package/src/page_search-results.html +2 -12
  78. package/src/page_tradePro_rewards_home_installer_message.html +56 -0
  79. package/src/page_tradePro_rewards_instore_installer_message.html +77 -0
  80. package/src/partials/scripts.hbs +0 -1
  81. package/src/scss/components/_custom-slider.scss +3 -125
  82. package/src/scss/components/_gift-cards.scss +357 -0
  83. package/src/scss/components/_popover-mini-basket.scss +4 -0
  84. package/src/scss/components/card-product-banner.scss +3 -91
  85. package/src/scss/components/checkout-payment-details-v2.scss +2 -0
  86. package/src/scss/pages/my-account-v2.scss +29 -0
  87. package/src/scss/pages/page_checkout_delivery-new.scss +19 -0
  88. package/src/scss/pages/page_products-list-combined.scss +0 -11
  89. package/src/scss/pages/page_products-list.scss +0 -8
  90. package/src/sitemap.html +8 -0
  91. package/build/js/mini-basket-slider.min.js +0 -1
  92. package/build/js/page/basket/basket-update-cart-action.js +0 -60
  93. package/build/js/page/basket/basket-update-cart.js +0 -29
  94. package/build/js/page/basket/basket-utils.js +0 -50
  95. package/build/js/page/basket/mini-basket-total.js +0 -97
  96. package/build/js/page/basket/quantity-change-handler.js +0 -56
  97. package/build/js/page/basket/update-quantity-operation.js +0 -37
  98. package/build/js/page/basket/update-quantity.js +0 -65
  99. package/build/js/page/components/mini-basket-slider.js +0 -535
  100. package/src/components/card_sponsor_banner.hbs +0 -8
  101. package/src/components/card_sponsor_product.hbs +0 -6
  102. package/src/components/mini-basket/mini-basket-order-item.hbs +0 -73
  103. package/src/js/components/banner-placement-manager.js +0 -258
  104. package/src/js/components/toggle-password-visibility.js +0 -58
  105. package/src/js/emulation/banner-placement-manager.js +0 -53
  106. package/src/js/emulation/mini-basket-data.js +0 -949
  107. package/src/js/page/basket/basket-update-cart-action.js +0 -60
  108. package/src/js/page/basket/basket-update-cart.js +0 -29
  109. package/src/js/page/basket/basket-utils.js +0 -50
  110. package/src/js/page/basket/mini-basket-total.js +0 -97
  111. package/src/js/page/basket/quantity-change-handler.js +0 -56
  112. package/src/js/page/basket/update-quantity-operation.js +0 -37
  113. package/src/js/page/basket/update-quantity.js +0 -65
  114. package/src/js/page/components/mini-basket-slider.js +0 -535
@@ -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,
8
- "mobile-position": 7,
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
- "isSponsor": true,
32
- "desktop-position": 5,
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
- "title": "Rangemaster Classic Deluxe 90 Ceramic Range Cooker Rangemaster Classic Deluxe 90 Ceramic Range Cooker",
52
- "code": "721657",
53
- "src": "https://media.wickes.co.uk/is/image/wickes/normal/Footwear-Tough-Grit-Oak-Boot-7~GPID_1100568107_00",
54
- "descr": "Offer is valid for the same product and size in a single purchase",
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-position": 6,
70
- "mobile-position": 8
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
  }
@@ -243,6 +243,12 @@
243
243
  "tradeproID": "fas fa-user-hard-hat"
244
244
  },
245
245
  "bannerText": "TradePro discount is automatically applied to all prices",
246
+ "banner": {
247
+ "classModifier": "notification_reminder",
248
+ "text": "You could be eligible for <b>10% off</b> TradePro discount.<a href='#' class='notification_link'><b>Learn More ></b></a>",
249
+ "reminder": true,
250
+ "mod": "_white"
251
+ },
246
252
  "activeOrders": {
247
253
  "sectionTitle": "My Active Orders",
248
254
  "orderList": [
@@ -1,4 +1,4 @@
1
- <div class="form-row {{#if clearInput}}form-row--clear-input{{/if}} {{#if error}}form-row_validation-error{{/if}} {{#if locked}}form-row--locked{{/if}} {{row-mod}}" {{#if required}}data-row-required{{/if}} {{#if clearInput}}data-clearable{{/if}} {{#if showContent}}data-show-content{{/if}} data-form-field>
1
+ <div class="form-row {{#if clearInput}}form-row--clear-input{{/if}} {{#if error}}form-row_validation-error{{/if}} {{#if locked}}form-row--locked{{/if}} {{row-mod}}" {{#if required}}data-row-required{{/if}} {{#if clearInput}}data-clearable{{/if}} {{#if showContent}}data-show-content{{/if}} {{#if skipGlobalValidation}}data-no-global-validation{{/if}} data-form-field>
2
2
  <label class="form-row__label {{#if required}}form-row__label_required{{/if}} {{#if label-hidden}}sr-only{{/if}}" for="{{id}}">
3
3
  {{label}}
4
4
  {{#if tooltip}}
@@ -1,7 +1,36 @@
1
1
  {{#if textarea}}
2
2
  <textarea class="tbx {{#if textarea}}tbx_textarea{{/if}} {{#if error}}tbx_error{{/if}}" rows="{{textareaRows}}" cols="{{textareaCols}}" value="{{value}}" maxlength="{{maxlength}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" {{#if disabled}}disabled{{/if}}></textarea>
3
3
  {{else if type}}
4
- <input type="{{type}}" class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" placeholder="{{placeholder}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}} {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}>
4
+ <input
5
+ type="{{type}}"
6
+ class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}"
7
+ value="{{value}}"
8
+ id="{{id}}"
9
+ name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}"
10
+ placeholder="{{placeholder}}"
11
+ {{#if (or locked disabled)}}disabled{{/if}}
12
+ {{#if need-pattern}}pattern=""{{/if}}
13
+ {{#if readonly}}readonly{{/if}}
14
+ {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}
15
+ {{#if maxlength}}maxlength="{{maxlength}}"{{/if}}
16
+ {{#if inputmode}}inputmode="{{inputmode}}"{{/if}}
17
+ {{#if autocomplete}}autocomplete="{{autocomplete}}"{{/if}}
18
+ >
5
19
  {{else}}
6
- <input type="text" class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}" value="{{value}}" id="{{id}}" name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}" placeholder="{{placeholder}}" {{#if (or locked disabled)}}disabled{{/if}} {{#if need-pattern}}pattern=""{{/if}} {{#if readonly}}readonly{{/if}} {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}>
20
+ <input
21
+ type="text"
22
+ class="tbx {{#if error}}tbx_error{{/if}} {{input-mod}}"
23
+ value="{{value}}"
24
+ id="{{id}}"
25
+ name="{{#if name}}{{name}}{{else}}{{id}}{{/if}}"
26
+ placeholder="{{placeholder}}"
27
+ {{#if (or locked disabled)}}disabled{{/if}}
28
+ {{#if need-pattern}}pattern=""{{/if}}
29
+ {{#if readonly}}readonly{{/if}}
30
+ {{#if data-tag}}data-tag="{{data-tag}}"{{/if}}
31
+ {{#if error}}aria-invalid="true"{{/if}}
32
+ {{#if maxlength}}maxlength="{{maxlength}}"{{/if}}
33
+ {{#if inputmode}}inputmode="{{inputmode}}"{{/if}}
34
+ {{#if autocomplete}}autocomplete="{{autocomplete}}"{{/if}}
35
+ >
7
36
  {{/if}}
@@ -0,0 +1,28 @@
1
+ <svg width="48" height="31" viewBox="0 0 48 31" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_9507_79257)">
3
+ <rect y="0.207031" width="48" height="30" rx="3" fill="white"/>
4
+ <path d="M42.5 26.207C39.5 25.707 36.5 21.207 36.5 21.207C36.5 21.207 34 25.207 31 26.207" stroke="#004587" stroke-width="1.8"/>
5
+ <path d="M29.7862 18.5774C30.7643 19.8755 32.9202 20.2323 35.2567 20.6584C35.2241 18.7373 34.7506 16.8572 33.7724 15.5591C32.7942 14.261 31.3287 13.7129 30.0307 14.691C28.7326 15.6692 28.808 17.2793 29.7862 18.5774Z" fill="white" stroke="#004587" stroke-width="1.8"/>
6
+ <path d="M43.164 18.5774C42.1859 19.8755 40.03 20.2323 37.6935 20.6584C37.7261 18.7373 38.1996 16.8572 39.1778 15.5591C40.1559 14.261 41.6215 13.7129 42.9195 14.691C44.2176 15.6692 44.1422 17.2793 43.164 18.5774Z" fill="white" stroke="#004587" stroke-width="1.8"/>
7
+ <g clip-path="url(#clip1_9507_79257)">
8
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3 0.207031V12.4151L16.5154 15.1785L30.0427 12.3838V0.207031H3Z" fill="white"/>
9
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.90234 1.08984V11.6893L16.5155 14.2625L29.1463 11.6881V1.08984H3.90234Z" fill="#004587"/>
10
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.7783 7.92572C15.7696 7.62779 15.5026 7.41921 15.207 7.41921C14.5493 7.41921 14.4462 7.96811 14.4462 8.45635C14.4462 8.91044 14.6458 9.37843 15.1424 9.37843C15.5498 9.37843 15.7562 9.14851 15.8118 8.77483H16.9531C16.8474 9.71885 16.1003 10.2603 15.1504 10.2603C14.0724 10.2603 13.2715 9.53599 13.2715 8.45635C13.2715 7.33602 13.9969 6.53516 15.1504 6.53516C16.0389 6.53516 16.8342 6.99838 16.9153 7.92572H15.7783Z" fill="white"/>
11
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M17.1543 5.31641H18.3288V7.81242L19.4004 6.63986H20.7594L19.4483 7.96917L20.9249 10.16H19.5089L18.6344 8.74224L18.3288 9.03322V10.16H17.1543V5.31641Z" fill="white"/>
12
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M21.7333 8.67923C21.7536 9.16013 22.0363 9.47999 22.535 9.47999C22.8166 9.47999 23.0924 9.35193 23.2046 9.09401H24.3016C24.0876 9.90917 23.32 10.2602 22.5192 10.2602C21.3542 10.2602 20.5586 9.56984 20.5586 8.38984C20.5586 7.30951 21.4374 6.53516 22.4916 6.53516C23.7754 6.53516 24.4182 7.48632 24.3632 8.67923H21.7333ZM23.189 8.03592C23.169 7.64149 22.8853 7.31607 22.4916 7.31607C22.0778 7.31607 21.8021 7.60794 21.7333 8.03592H23.189Z" fill="white"/>
13
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M25.5842 8.99642C25.5842 9.17551 25.6574 9.30418 25.7769 9.39104C25.8863 9.47275 26.0451 9.51434 26.2117 9.51434C26.4397 9.51434 26.7649 9.42043 26.7649 9.13997C26.7649 8.86835 26.3976 8.81603 26.1918 8.76798C25.4513 8.58432 24.5267 8.56159 24.5267 7.61548C24.5267 6.76836 25.4589 6.53516 26.1636 6.53516C26.9515 6.53516 27.7712 6.76041 27.8136 7.67723H26.7287C26.7287 7.52613 26.6751 7.43222 26.5773 7.36908C26.4792 7.30941 26.3507 7.28013 26.2052 7.28013C26.0108 7.28013 25.7017 7.30207 25.7017 7.54688C25.7017 7.87886 26.4881 7.93992 27.0274 8.05399C27.75 8.19744 27.9381 8.71249 27.9381 9.00545C27.9381 9.94987 27.0274 10.2602 26.2187 10.2602C25.3684 10.2602 24.4986 9.98342 24.4639 8.99642H25.5842Z" fill="white"/>
14
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10.3756 10.16H9.08877L8.41406 6.82332H8.3981L7.72329 10.16H6.41975L5.08691 5.31641H6.36913L7.0693 8.85571H7.08112L7.80504 5.31641H9.01268L9.73841 8.85571H9.75195L10.4494 5.31641H11.7329L10.3756 10.16Z" fill="white"/>
15
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.8215 6.19887H12.9972V5.31641H11.8215V6.19887ZM11.8213 10.1601H12.997V6.63986H11.8213V10.1601Z" fill="white"/>
16
+ </g>
17
+ <path d="M36.5 0.207031V21.707M36.5 30.207V21.707M36.5 21.707H47.5M36.5 21.707H1" stroke="#004587" stroke-width="1.8"/>
18
+ </g>
19
+ <rect x="0.5" y="0.707031" width="47" height="29" rx="2.5" stroke="#CCCCCC"/>
20
+ <defs>
21
+ <clipPath id="clip0_9507_79257">
22
+ <rect y="0.207031" width="48" height="30" rx="3" fill="white"/>
23
+ </clipPath>
24
+ <clipPath id="clip1_9507_79257">
25
+ <rect width="27" height="14.9703" fill="white" transform="translate(3 0.207031)"/>
26
+ </clipPath>
27
+ </defs>
28
+ </svg>
@@ -13,7 +13,4 @@ createPopupSlider({
13
13
  showSlider();
14
14
  $(el.sliderWrap).on('scroll', _.debounce(() => handleScroll(el.sliderWrap), 100));
15
15
  },
16
- onClose: function () {
17
- Wick.MiniBasketSliderFE.cartEntries = [];
18
- }
19
16
  });
@@ -8,7 +8,7 @@ function createEvent(eventName, payload, eventDetail) {
8
8
  });
9
9
  }
10
10
 
11
- function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend, onClose }) {
11
+ function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend }) {
12
12
  const events = {
13
13
  CLOSE_JUST_ADDED: 'CLOSE_JUST_ADDED',
14
14
  CLOSE_MINI_BASKET: 'CLOSE_MINI_BASKET'
@@ -119,9 +119,6 @@ function createPopupSlider({ type, sliderSelector, onAppendEvent, onAppend, onCl
119
119
  .finally(() => {
120
120
  hideSlider();
121
121
  Wick.Backdrop.hide();
122
- if (typeof onClose === 'function') {
123
- onClose();
124
- }
125
122
  })
126
123
  }
127
124
 
@@ -0,0 +1,8 @@
1
+ createPopupSlider({
2
+ type: 'miniBasket',
3
+ sliderSelector: '.custom-slider.mini-basket',
4
+ onAppendEvent: 'showMiniBasket',
5
+ onAppend: function (event, { showSlider }) {
6
+ showSlider();
7
+ },
8
+ });
@@ -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
+ })
@@ -0,0 +1,35 @@
1
+ var Wick = Wick || {};
2
+ Wick.CheckoutData = (function () {
3
+ return {
4
+ //TODO: update after BE confirmation
5
+ successGiftCardData: {
6
+ "subTotal": "£85.00",
7
+ "deliveryCost": "£4.00",
8
+ "freeDelivery": false,
9
+ "clickAndCollectCost": "FREE",
10
+ "totalForDelivery": "£69.00",
11
+ "totalForClickAndCollect": "FREE",
12
+ "total": "£67.00",
13
+ "vat": "£11.17",
14
+ "deliveryOrder": true,
15
+ "clickAndCollectOrder": false,
16
+ "discountTotal": "£2.00",
17
+ "giftCardApplied": "-£100.00",
18
+ "discounts": [
19
+ "Spend over £10 and get £2 fixed discount"
20
+ ],
21
+ "promotionsInfo": [
22
+ {
23
+ "description": "Spend over £10 and get £2 fixed discount",
24
+ "usedCouponCode": "RT_02"
25
+ }
26
+ ],
27
+ "subTotalWithDeliveryCost": "£69.00",
28
+ "net": false,
29
+ "subtotalWithDeliveryAndDiscounts": "£67.00",
30
+ "discountAmounts": [],
31
+ "goodsTotalWithoutDiscount": "£65.00",
32
+ "charityPrice": ""
33
+ },
34
+ }
35
+ })();
@@ -2,24 +2,33 @@ var Wick = Wick || {};
2
2
 
3
3
  Wick.PaymentDetails = (function () {
4
4
  var $btnEnterDetails = $('.btn-enter-details'),
5
- $form = $btnEnterDetails.parents('form'),
6
5
  isGuestPage = $('.page_checkout-payment-details_guest').length;
7
6
 
8
7
  function bindEvents () {
9
- $btnEnterDetails.on('click', function(){
10
- if ($form.find('#card-name').val().length &&
11
- $form.find('#first-line-address').val().length &&
12
- $form.find('#address-line-1').val().length &&
13
- $form.find('#town-city').val().length &&
14
- $form.find('#postcode_additional').val().length){
15
- $('.checkout-payment-details__card-details').removeClass('checkout-payment-details__card-details_hidden');
16
- $('html, body').animate({
17
- scrollTop: $('.checkout-payment-details__card-details').offset().top - 15
18
- }, 700);
19
- return false;
8
+ $btnEnterDetails.on('click', function (e) {
9
+ e.preventDefault();
10
+ var $scope = $(this).closest('form');
11
+ if (!$scope.length) $scope = $(this).closest('.billing-address');
12
+ if (!$scope.length) $scope = $('.billing-address');
13
+ var nameVal= ($scope.find('#card-name').val() || '').trim();
14
+ var finderVal= ($scope.find('#first-line-address').val() || '').trim();
15
+ var manualLine1= ($scope.find('#address-line-1').val() || '').trim();
16
+ var manualTown= ($scope.find('#town-city').val() || '').trim();
17
+ var manualPost= ($scope.find('#postcode_additional').val() || '').trim();
18
+ var addressFinderOk = finderVal.length > 0;
19
+ var addressManualOk = manualLine1 && manualTown && manualPost;
20
+
21
+ if (nameVal && (addressFinderOk || addressManualOk)) {
22
+ var $details = $('.checkout-payment-details__card-details');
23
+ $details.removeClass('checkout-payment-details__card-details_hidden');
24
+ $('html, body').animate({ scrollTop: $details.offset().top - 15 }, 700);
25
+ return;
26
+ }
27
+
28
+ var formEl = $scope.closest('form').get(0) || $scope.get(0);
29
+ if (formEl && Wick.Forms && Wick.Forms.showValidationErrors) {
30
+ Wick.Forms.showValidationErrors(formEl);
20
31
  }
21
- Wick.Forms.showValidationErrors($form[0]);
22
- return false;
23
32
  });
24
33
 
25
34
  $('.checkout-payment-details__card-details').on('submit', function(){
@@ -7,16 +7,22 @@ function simulateHybrisSendingHtml() {
7
7
  document.dispatchEvent(event);
8
8
  }
9
9
 
10
- function bindResolveEvent(events) {
11
- $(window).on(events.join(' '), function ({ detail: { resolve } }) {
10
+ function initCloseJustAddedDiff() {
11
+ $(window).on('CLOSE_JUST_ADDED CLOSE_MINI_BASKET', function ({ detail: { resolve }}) {
12
12
  setTimeout(() => {
13
- resolve();
13
+ return resolve();
14
14
  }, 200);
15
15
  });
16
+ };
17
+
18
+ function simulateShowMiniBasket() {
19
+ const event = new CustomEvent('showMiniBasket', {});
20
+ document.dispatchEvent(event);
16
21
  }
17
22
 
18
23
  $(document).ready(function () {
19
24
  $('.btn-add-to-basket').on('click', simulateHybrisSendingHtml);
25
+ $('.header-minicart__btn').on('click', simulateShowMiniBasket);
20
26
 
21
- bindResolveEvent(['CLOSE_JUST_ADDED', 'CLOSE_MINI_BASKET', 'MINI_BASKET_CHECKOUT', 'MINI_BASKET_VIEW_BASKET']);
27
+ initCloseJustAddedDiff();
22
28
  });
@@ -60,11 +60,16 @@ Wick.Forms = (function(){
60
60
 
61
61
  var showValidationErrors = function (form, errorMsg) {
62
62
  var $form = $(form);
63
+ var $rows = $form.find(fieldRow).not('[data-no-global-validation]');
64
+ if (!$rows.length) return;
65
+ $rows.find('.form-row__error').remove();
66
+
63
67
  if (!$form.hasClass(formInvalid)) {
64
- $form.find('.form-row__error').remove();
65
- $form.addClass(formInvalid).find(fieldRow).append(validationError(errorMsg)).addClass(rowValidationError);
68
+ $form.addClass(formInvalid);
66
69
  }
67
70
 
71
+ $rows.append(validationError(errorMsg)).addClass(rowValidationError);
72
+
68
73
  var $firstMsg = $form.find(fieldRow).first();
69
74
  if($firstMsg.length && !isElementInViewport($firstMsg)){
70
75
  var inModal = $firstMsg.closest('.modal').length,