wickes-css2 2.111.0-develop.2 → 2.111.0-why-not-add.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/Readme.md +1 -1
  2. package/build/css/category-main.css +1 -1
  3. package/build/css/components/global-search.css +1 -1
  4. package/build/css/homepage-main.css +1 -1
  5. package/build/css/kitchen-plp-main.css +1 -1
  6. package/build/css/main.css +1 -1
  7. package/build/css/my-account-main-v2.css +1 -1
  8. package/build/css/my-account-main.css +1 -1
  9. package/build/css/pages/page_personal-details.css +1 -1
  10. package/build/css/pages/page_product-details-v2.css +1 -1
  11. package/build/css/pdp-main-before-combine.css +1 -1
  12. package/build/css/pdp-main-critical.css +1 -1
  13. package/build/css/pdp-main-non-critical.css +1 -1
  14. package/build/css/pdp-main.css +1 -1
  15. package/build/css/plp-main.css +1 -1
  16. package/build/css/store-locator-main.css +1 -1
  17. package/build/js/account-hub.min.js +1 -1
  18. package/build/js/basket.min.js +2 -2
  19. package/build/js/bloomreach-widget.min.js +1 -0
  20. package/build/js/bundle.min.js +1 -1
  21. package/build/js/checkout.min.js +2 -2
  22. package/build/js/emulation.min.js +3001 -280
  23. package/build/js/general.bundle.min.js +1 -1
  24. package/build/js/gift-cards.min.js +1 -1
  25. package/build/js/merged-checkout.min.js +2 -2
  26. package/build/js/mini-basket-slider.min.js +1 -1
  27. package/build/js/page/basket-v2.js +18 -11
  28. package/build/js/page/bloomreach-widget.js +1187 -0
  29. package/build/js/page/components/discounts.js +8 -15
  30. package/build/js/page/components/mini-basket-slider.js +24 -18
  31. package/build/js/page/components/voucher.js +2 -56
  32. package/build/js/page/utils/create-count-stepper.js +30 -9
  33. package/build/js/page/utils/create-loading-button.js +37 -0
  34. package/build/js/page/utils/create-toast.js +79 -0
  35. package/build/js/page/utils/custom-dropdown.js +80 -0
  36. package/build/js/pdp-count-stepper.min.js +1 -1
  37. package/build/js/pdp.bundle.min.js +1 -1
  38. package/build/js/plp.bundle.min.js +1 -1
  39. package/build/js/project-list.min.js +1 -1
  40. package/build/js/saving-shopping-list.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/components/base/button.hbs +23 -5
  43. package/src/components/bloomreach/complete-card-dropdown.hbs +47 -0
  44. package/src/components/bloomreach/complete-card-skeleton.hbs +19 -0
  45. package/src/components/bloomreach/complete-card.hbs +138 -0
  46. package/src/components/bloomreach/complete-divider.hbs +3 -0
  47. package/src/components/bloomreach/complete-summary-skeleton.hbs +12 -0
  48. package/src/components/bloomreach/complete-summary.hbs +43 -0
  49. package/src/components/bloomreach/complete-wrapper.hbs +1 -0
  50. package/src/components/bloomreach/complete-your-project.hbs +21 -0
  51. package/src/components/cart-voucher.hbs +4 -4
  52. package/src/components/gift-cards.hbs +1 -1
  53. package/src/components/mini-basket/mini-basket-order-item.hbs +4 -4
  54. package/src/components/wismo-payment.hbs +7 -50
  55. package/src/data/data_delivery-address-v2.json +6 -6
  56. package/src/data/data_discounts.json +6 -6
  57. package/src/data/data_shopping-cart-v2.json +11 -32
  58. package/src/data/data_shopping-cart-with-energy.json +12 -12
  59. package/src/data/data_wismo.json +1 -2
  60. package/src/elements/checkbox.hbs +8 -1
  61. package/src/js/components/general/cart-slider.js +19 -6
  62. package/src/js/components/general/switchVat.js +7 -9
  63. package/src/js/emulation/basket-data.js +1 -11
  64. package/src/js/emulation/bloomreach-widget-calculations.js +132 -0
  65. package/src/js/emulation/bloomreach-widget-loading.js +11 -0
  66. package/src/js/emulation/checkout-data.js +0 -3
  67. package/src/js/emulation/mini-basket-data.js +0 -68
  68. package/src/js/emulation/mock.js +3098 -1
  69. package/src/js/emulation/notify-me.js +1 -1
  70. package/src/js/page/basket-v2.js +18 -11
  71. package/src/js/page/bloomreach-widget.js +1187 -0
  72. package/src/js/page/components/discounts.js +8 -15
  73. package/src/js/page/components/mini-basket-slider.js +24 -18
  74. package/src/js/page/components/voucher.js +2 -56
  75. package/src/js/page/utils/create-count-stepper.js +30 -9
  76. package/src/js/page/utils/create-loading-button.js +37 -0
  77. package/src/js/page/utils/create-toast.js +79 -0
  78. package/src/js/page/utils/custom-dropdown.js +80 -0
  79. package/src/layouts/checkout.hbs +0 -1
  80. package/src/page_basket-energy-efficiency.html +0 -4
  81. package/src/page_checkout_confirmation-new-marketing-consent-error.html +0 -7
  82. package/src/page_checkout_confirmation-new-marketing-consent.html +0 -4
  83. package/src/page_checkout_delivery-address-v2.html +0 -4
  84. package/src/page_checkout_delivery-details-v2-asm.html +1 -7
  85. package/src/page_checkout_delivery-details-v2-calendar-message.html +0 -4
  86. package/src/page_checkout_delivery-details-v2-oos.html +0 -4
  87. package/src/page_checkout_delivery-details-v2-wisdom-not-available.html +0 -4
  88. package/src/page_checkout_delivery-details-v2-wisdom.html +0 -4
  89. package/src/page_checkout_delivery-details-with-loader-v2.html +0 -4
  90. package/src/page_checkout_delivery-details_guest-new.html +0 -4
  91. package/src/page_checkout_delivery_address-asm-new.html +0 -4
  92. package/src/page_checkout_merge-basket-v2.html +3 -6
  93. package/src/page_checkout_merge-basket-vat-v2.html +1 -6
  94. package/src/page_checkout_merge-basket-with-energy.html +0 -4
  95. package/src/page_checkout_next-day-delivery-details.html +0 -4
  96. package/src/page_checkout_payment-details-v2-asm.html +0 -4
  97. package/src/page_checkout_payment-details-v2.html +0 -4
  98. package/src/page_checkout_payment-details_guest-click-collect-icon.html +0 -4
  99. package/src/page_checkout_payment-details_guest-with-checkout-journey.html +0 -7
  100. package/src/page_checkout_payment-details_login-with-checkout-journey.html +0 -7
  101. package/src/page_checkout_payment-details_with-card-loader.html +0 -4
  102. package/src/page_checkout_payment-details_with-loader-v2.html +0 -4
  103. package/src/page_checkout_rapid-delivery-details.html +0 -4
  104. package/src/page_empty-basket-instore.html +0 -4
  105. package/src/page_homepage-with-global-search-v2-vat.html +0 -1
  106. package/src/page_instore_progress_bar.html +0 -4
  107. package/src/page_product-details-banner.html +0 -1
  108. package/src/page_product-details-big-wins-disabled-delivery.html +0 -1
  109. package/src/page_product-details-big-wins-non-registered.html +0 -1
  110. package/src/page_product-details-big-wins-out-nearest.html +0 -1
  111. package/src/page_product-details-big-wins-unhappy.html +0 -1
  112. package/src/page_product-details-big-wins.html +0 -1
  113. package/src/page_product-details-billie.html +0 -1
  114. package/src/page_product-details-bloomreach.html +130 -0
  115. package/src/page_product-details-calculator.html +0 -1
  116. package/src/page_product-details-cashback-v2.html +0 -1
  117. package/src/page_product-details-clearpay.html +0 -1
  118. package/src/page_product-details-cnc-error-notification.html +0 -1
  119. package/src/page_product-details-cnc-success-notification-vat.html +0 -1
  120. package/src/page_product-details-cnc-success-notification.html +0 -1
  121. package/src/page_product-details-default-store.html +0 -1
  122. package/src/page_product-details-energy-efficiency.html +0 -1
  123. package/src/page_product-details-flooring-with-pr-placeholder.html +0 -1
  124. package/src/page_product-details-flooring.html +0 -1
  125. package/src/page_product-details-gallery-actual.html +0 -1
  126. package/src/page_product-details-mfe-calculator.html +0 -1
  127. package/src/page_product-details-minimum-v2.html +0 -1
  128. package/src/page_product-details-mtm-doors.html +0 -1
  129. package/src/page_product-details-only-clearpay.html +0 -1
  130. package/src/page_product-details-paint-mixing.html +0 -1
  131. package/src/page_product-details-saved-pl.html +0 -1
  132. package/src/page_product-details-tile-steps-klarna-widget-with-method-ids.html +0 -1
  133. package/src/page_product-details-tile-steps-logout.html +0 -1
  134. package/src/page_product-details-tile-steps-no-new-project-list.html +0 -1
  135. package/src/page_product-details-tile-steps-with-klarna.html +0 -1
  136. package/src/page_product-details-tile-steps.html +0 -1
  137. package/src/page_product-details-v2.html +0 -1
  138. package/src/page_product-details-vat.html +0 -1
  139. package/src/page_product-details-wisdom-mcfc-registered.html +0 -1
  140. package/src/page_product-details-wisdom-mcfc.html +0 -1
  141. package/src/page_product-details-wisdom-oos-registered.html +0 -1
  142. package/src/page_product-details-wisdom-oos.html +0 -1
  143. package/src/page_product-details-wisdom-registered.html +0 -1
  144. package/src/page_product-details-wisdom.html +0 -1
  145. package/src/page_product-details-with-favourite.html +0 -1
  146. package/src/page_product-details-with-global-search-v2.html +7 -2
  147. package/src/page_product-details_no-previous-default.html +0 -1
  148. package/src/page_shopping-cart-registered-v2.html +0 -4
  149. package/src/page_shopping-cart-v2-vat.html +0 -6
  150. package/src/page_shopping-cart-v2.html +2 -5
  151. package/src/page_shopping-cart-v3-instore.html +0 -4
  152. package/src/page_track-my-order-result.html +1 -0
  153. package/src/partials/scripts.hbs +1 -0
  154. package/src/scss/common/_common.scss +1 -0
  155. package/src/scss/common/_elements.scss +13 -1
  156. package/src/scss/common/_loading-button.scss +49 -0
  157. package/src/scss/components/_notifications.scss +86 -5
  158. package/src/scss/components/bloomreach/_bloomreach.scss +3 -0
  159. package/src/scss/components/bloomreach/_complete-card-dropdown.scss +174 -0
  160. package/src/scss/components/bloomreach/_complete-card.scss +408 -0
  161. package/src/scss/components/bloomreach/_complete-your-project.scss +207 -0
  162. package/src/scss/components/global-search.scss +0 -11
  163. package/src/scss/globals/_global-components.scss +0 -1
  164. package/src/scss/helpers/_variables.scss +1 -0
  165. package/src/scss/main.scss +0 -2
  166. package/src/scss/pages/page_product-details-v2.scss +45 -2
  167. package/src/scss/pdp-main-critical.scss +0 -1
  168. package/src/scss/pdp-main.scss +1 -1
  169. package/src/sitemap.html +6 -0
  170. package/src/components/checkout-voucher-remove-modal.hbs +0 -16
  171. package/src/components/tradepro-discount-banner.hbs +0 -8
  172. package/src/js/components/general/tradepro-discount-banner.js +0 -69
  173. package/src/js/emulation/tradepro-discount-banner-emulation.js +0 -13
  174. package/src/scss/components/_checkout-voucher-remove-modal.scss +0 -108
  175. package/src/scss/components/_pdp-action-v2-critical.scss +0 -27
  176. package/src/scss/components/_pdp-action-v2.scss +0 -27
  177. package/src/scss/components/_tradepro-discount-banner.scss +0 -78
@@ -47,24 +47,24 @@
47
47
  <i class="fal fa-plus quantity-cta-icon"></i>
48
48
  </button>
49
49
  </div>
50
- {{#if (eq item.displayBasePrice.value 0)}}
50
+ {{#if (eq item.basePrice.value 0)}}
51
51
  <span class="order-item__value product-card__price-value">FREE</span>
52
52
  {{else}}
53
53
  {{#if (isToggleVatAvailable)}}
54
54
  <div class="price including-vat-inherit">
55
55
  <span class="product-card__price-value">
56
- <span class="order-item__value">{{item.displayBasePrice.formattedValue}}</span>
56
+ <span class="order-item__value">{{item.basePrice.formattedValue}}</span>
57
57
  <span class="inc">Inc.VAT</span>
58
58
  </span>
59
59
  </div>
60
60
  <div class="price excluding-vat-inherit">
61
61
  <span class="product-card__price-value">
62
- <span class="order-item__value">{{item.displayBasePriceExclusiveVat.formattedValue}}</span>
62
+ <span class="order-item__value">{{item.basePriceExcVat.formattedValue}}</span>
63
63
  <span class="inc">Exc.VAT</span>
64
64
  </span>
65
65
  </div>
66
66
  {{else}}
67
- <span class="price product-card__price-value">{{item.displayBasePrice.formattedValue}}</span>
67
+ <span class="price product-card__price-value">{{item.basePrice.formattedValue}}</span>
68
68
  {{/if}}
69
69
  {{/if}}
70
70
  </div>
@@ -4,14 +4,7 @@
4
4
  {{#each wismo-order-payment-klarna.items}}
5
5
  <div class="wrap-item">
6
6
  <div class="wrap-item__name">{{{name}}}</div>
7
- <div class="wrap-item__value">
8
- {{#ifCond ../switch-vat '&&' valueExcVat}}
9
- <span class="including-vat">{{{value}}}</span>
10
- <span class="excluding-vat d-none">{{{valueExcVat}}}</span>
11
- {{else}}
12
- {{{value}}}
13
- {{/ifCond}}
14
- </div>
7
+ <div class="wrap-item__value">{{{value}}}</div>
15
8
  </div>
16
9
  {{/each}}
17
10
  {{else if payment-apple}}
@@ -19,12 +12,7 @@
19
12
  <div class="wrap-item">
20
13
  <div class="wrap-item__name">{{{name}}}</div>
21
14
  <div class="wrap-item__value">
22
- {{#ifCond ../switch-vat '&&' valueExcVat}}
23
- <span class="including-vat">{{{value}}}</span>
24
- <span class="excluding-vat d-none">{{{valueExcVat}}}</span>
25
- {{else}}
26
- {{{value}}}
27
- {{/ifCond}}
15
+ {{{value}}}
28
16
  <p class="pt-3">{{additional-value}}</p>
29
17
  </div>
30
18
  </div>
@@ -34,12 +22,7 @@
34
22
  <div class="wrap-item">
35
23
  <div class="wrap-item__name">{{{name}}}</div>
36
24
  <div class="wrap-item__value">
37
- {{#ifCond ../switch-vat '&&' valueExcVat}}
38
- <span class="including-vat">{{{value}}}</span>
39
- <span class="excluding-vat d-none">{{{valueExcVat}}}</span>
40
- {{else}}
41
- {{{value}}}
42
- {{/ifCond}}
25
+ {{{value}}}
43
26
  <p class="pt-3">{{additional-value}}</p>
44
27
  </div>
45
28
  </div>
@@ -49,12 +32,7 @@
49
32
  <div class="wrap-item">
50
33
  <div class="wrap-item__name">{{{name}}}</div>
51
34
  <div class="wrap-item__value">
52
- {{#ifCond ../switch-vat '&&' valueExcVat}}
53
- <span class="including-vat">{{{value}}}</span>
54
- <span class="excluding-vat d-none">{{{valueExcVat}}}</span>
55
- {{else}}
56
- {{{value}}}
57
- {{/ifCond}}
35
+ {{{value}}}
58
36
  <p class="pt-3">{{additional-value}}</p>
59
37
  </div>
60
38
  </div>
@@ -71,14 +49,7 @@
71
49
  {{else}}
72
50
  <div class="wrap-item">
73
51
  <div class="wrap-item__name">{{{this.name}}}</div>
74
- <div class="wrap-item__value">
75
- {{#ifCond ../switch-vat '&&' this.valueExcVat}}
76
- <span class="including-vat">{{{this.value}}}</span>
77
- <span class="excluding-vat d-none">{{{this.valueExcVat}}}</span>
78
- {{else}}
79
- {{{this.value}}}
80
- {{/ifCond}}
81
- </div>
52
+ <div class="wrap-item__value">{{{this.value}}}</div>
82
53
  </div>
83
54
  {{/if}}
84
55
  {{/each}}
@@ -86,28 +57,14 @@
86
57
  {{#each wismo-order-payment-clearpay.items}}
87
58
  <div class="wrap-item">
88
59
  <div class="wrap-item__name">{{{name}}}</div>
89
- <div class="wrap-item__value">
90
- {{#ifCond ../switch-vat '&&' valueExcVat}}
91
- <span class="including-vat">{{{value}}}</span>
92
- <span class="excluding-vat d-none">{{{valueExcVat}}}</span>
93
- {{else}}
94
- {{{value}}}
95
- {{/ifCond}}
96
- </div>
60
+ <div class="wrap-item__value">{{{value}}}</div>
97
61
  </div>
98
62
  {{/each}}
99
63
  {{else}}
100
64
  {{#each wismo-order-payment.items}}
101
65
  <div class="wrap-item">
102
66
  <div class="wrap-item__name">{{{name}}}</div>
103
- <div class="wrap-item__value">
104
- {{#ifCond ../switch-vat '&&' valueExcVat}}
105
- <span class="including-vat">{{{value}}}</span>
106
- <span class="excluding-vat d-none">{{{valueExcVat}}}</span>
107
- {{else}}
108
- {{{value}}}
109
- {{/ifCond}}
110
- </div>
67
+ <div class="wrap-item__value">{{{value}}}</div>
111
68
  </div>
112
69
  {{/each}}
113
70
  {{/if}}
@@ -29,24 +29,24 @@
29
29
  ],
30
30
  "discounts": [
31
31
  {
32
- "displayDescription": "Voucher abcd applies and giving 20% off",
32
+ "text": "Voucher abcd applies and giving 20% off",
33
33
  "isDeletable": true
34
34
  },
35
35
  {
36
- "displayDescription": "Voucher 20% off",
36
+ "text": "Voucher 20% off",
37
37
  "isDeletable": true
38
38
  },
39
39
  {
40
- "displayDescription": "Buy 4 for 3"
40
+ "text": "Buy 4 for 3"
41
41
  },
42
42
  {
43
- "displayDescription": "Online only offer"
43
+ "text": "Online only offer"
44
44
  },
45
45
  {
46
- "displayDescription": "2 for £35"
46
+ "text": "2 for £35"
47
47
  },
48
48
  {
49
- "displayDescription": "Offer price equivalent to £17.50 per item"
49
+ "text": "Offer price equivalent to £17.50 per item"
50
50
  }
51
51
  ],
52
52
  "total": {
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "discounts": [
3
3
  {
4
- "displayDescription": "Voucher abcd applies and giving 20% off",
4
+ "text": "Voucher abcd applies and giving 20% off",
5
5
  "isDeletable": true
6
6
  },
7
7
  {
8
- "displayDescription": "Voucher 20% off",
8
+ "text": "Voucher 20% off",
9
9
  "isDeletable": true
10
10
  },
11
11
  {
12
- "displayDescription": "Buy 4 for 3"
12
+ "text": "Buy 4 for 3"
13
13
  },
14
14
  {
15
- "displayDescription": "Online only offer"
15
+ "text": "Online only offer"
16
16
  },
17
17
  {
18
- "displayDescription": "2 for £35"
18
+ "text": "2 for £35"
19
19
  },
20
20
  {
21
- "displayDescription": "Offer price equivalent to £17.50 per item"
21
+ "text": "Offer price equivalent to £17.50 per item"
22
22
  }
23
23
  ]
24
24
  }
@@ -44,52 +44,31 @@
44
44
  ],
45
45
  "discounts": [
46
46
  {
47
- "displayDescription": "Voucher abcd applies and giving 20% off",
48
- "displayDescriptionExclusiveVat": "Voucher abcd applies and giving 18% off",
47
+ "text": "Voucher abcd applies and giving 20% off",
48
+ "textExcVat": "Voucher abcd applies and giving 18% off",
49
49
  "isDeletable": true
50
50
  },
51
51
  {
52
- "displayDescription": "Voucher 20% off",
53
- "displayDescriptionExclusiveVat": "Voucher 18% off",
52
+ "text": "Voucher 20% off",
53
+ "textExcVat": "Voucher 18% off",
54
54
  "isDeletable": true
55
55
  },
56
56
  {
57
- "displayDescription": "Buy 4 for 3",
58
- "displayDescriptionExclusiveVat": "Buy 5 for 3"
57
+ "text": "Buy 4 for 3",
58
+ "textExcVat": "Buy 5 for 3"
59
59
  },
60
60
  {
61
- "displayDescription": "Online only offer"
61
+ "text": "Online only offer"
62
62
  },
63
63
  {
64
- "displayDescription": "2 for £35",
65
- "displayDescriptionExclusiveVat": "2 for £30"
64
+ "text": "2 for £35",
65
+ "textExcVat": "2 for £30"
66
66
  },
67
67
  {
68
- "displayDescription": "Offer price equivalent to £17.50 per item",
69
- "displayDescriptionExclusiveVat": "Offer price equivalent to £15.50 per item"
68
+ "text": "Offer price equivalent to £17.50 per item",
69
+ "textExcVat": "Offer price equivalent to £15.50 per item"
70
70
  }
71
71
  ],
72
- "voucher-remove-popup": {
73
- "title": "Remove {coupon name} discount?",
74
- "headerIcon": "fas fa-exclamation-circle",
75
- "description": "Are you sure you want to remove your {coupon name} discount from this order? The total cost of your order will increase.",
76
- "actions": {
77
- "mod": "actions",
78
- "buttons": [
79
- {
80
- "title": "Cancel",
81
- "isPrimary": true,
82
- "close-modal": true
83
- },
84
- {
85
- "mod": "btn-continue",
86
- "data-action": "confirm-voucher-remove",
87
- "title": "Yes, continue",
88
- "isSecondary": true
89
- }
90
- ]
91
- }
92
- },
93
72
  "total": {
94
73
  "title": "Total:",
95
74
  "value": "£430.95"
@@ -42,24 +42,24 @@
42
42
  ],
43
43
  "discounts": [
44
44
  {
45
- "displayDescription": "Voucher abcd applies and giving 20% off",
45
+ "text": "Voucher abcd applies and giving 20% off",
46
46
  "isDeletable": true
47
47
  },
48
48
  {
49
- "displayDescription": "Voucher 20% off",
49
+ "text": "Voucher 20% off",
50
50
  "isDeletable": true
51
51
  },
52
52
  {
53
- "displayDescription": "Buy 4 for 3"
53
+ "text": "Buy 4 for 3"
54
54
  },
55
55
  {
56
- "displayDescription": "Online only offer"
56
+ "text": "Online only offer"
57
57
  },
58
58
  {
59
- "displayDescription": "2 for £35"
59
+ "text": "2 for £35"
60
60
  },
61
61
  {
62
- "displayDescription": "Offer price equivalent to £17.50 per item"
62
+ "text": "Offer price equivalent to £17.50 per item"
63
63
  }
64
64
  ],
65
65
  "total": {
@@ -749,24 +749,24 @@
749
749
  ],
750
750
  "discounts": [
751
751
  {
752
- "displayDescription": "Voucher abcd applies and giving 20% off",
752
+ "text": "Voucher abcd applies and giving 20% off",
753
753
  "isDeletable": true
754
754
  },
755
755
  {
756
- "displayDescription": "Voucher 20% off",
756
+ "text": "Voucher 20% off",
757
757
  "isDeletable": true
758
758
  },
759
759
  {
760
- "displayDescription": "Buy 4 for 3"
760
+ "text": "Buy 4 for 3"
761
761
  },
762
762
  {
763
- "displayDescription": "Online only offer"
763
+ "text": "Online only offer"
764
764
  },
765
765
  {
766
- "displayDescription": "2 for £35"
766
+ "text": "2 for £35"
767
767
  },
768
768
  {
769
- "displayDescription": "Offer price equivalent to £17.50 per item"
769
+ "text": "Offer price equivalent to £17.50 per item"
770
770
  }
771
771
  ],
772
772
  "total": {
@@ -68,8 +68,7 @@
68
68
  },
69
69
  {
70
70
  "name": "Voucher:",
71
- "value": "<div>Wickes TradePro 10% Saving</div><div>20% off <br> Discount applied at checkout</div><div>Buy 3 get 1 free</div><div>Buy 2 for £30 <br>Not Available for Mix &amp; Match</div><div>Buy 2 get 1 free <br>Not Available for Mix &amp; Match</div><div>Buy any Product_103178 or 542003 with any Product_543265 or 148268 &amp; save up to £6.5</div>",
72
- "valueExcVat": "<div>Wickes TradePro 10% Saving</div><div>20% off <br> Discount applied at checkout</div><div>Buy 3 get 1 free</div><div>Buy 2 for £25 <br>Not Available for Mix &amp; Match</div><div>Buy 2 get 1 free <br>Not Available for Mix &amp; Match</div><div>Buy any Product_103178 or 542003 with any Product_543265 or 148268 &amp; save up to £5.42</div>"
71
+ "value": "-"
73
72
  }
74
73
  ]
75
74
  },
@@ -1,4 +1,11 @@
1
- <label for="{{id}}" class="chb {{#if required}}form-row__label_required{{/if}} {{#if inactive-message}}chb-inactive{{/if}}">
1
+ <label
2
+ for="{{id}}"
3
+ class="chb
4
+ {{#if required}}form-row__label_required{{/if}}
5
+ {{#if inactive-message}}chb-inactive{{/if}}
6
+ {{#if action}}chb--action{{/if}}
7
+ "
8
+ >
2
9
  <input
3
10
  type="checkbox"
4
11
  value="{{value}}"
@@ -5,17 +5,30 @@ createPopupSlider({
5
5
  sliderSelector: '.custom-slider.just-added',
6
6
  onAppendEvent: 'productAddedToCart',
7
7
  onAppend: function (event, { showSlider, handleScroll, el }) {
8
+ Wick.MiniBasketSliderFE.isMiniBasketLoaded = false;
9
+
10
+ if (event.detail.bulkAddToCartData) {
11
+ return;
12
+ }
13
+
8
14
  if (!$('.custom-slider.just-added').length) {
9
15
  $('body').append(cartSliderHTML);
10
16
  }
17
+
11
18
  const htmlContent = event.detail.html;
12
- $(el.slider).append(htmlContent);
19
+
20
+ if (htmlContent) {
21
+ $(el.slider).append(htmlContent);
22
+ }
23
+
13
24
  showSlider();
14
- Wick.MiniBasketSliderFE.isMiniBasketLoaded = false;
15
- $(el.sliderWrap).on(
16
- 'scroll',
17
- _.debounce(() => handleScroll(el.sliderWrap), 100)
18
- );
25
+
26
+ if ($(el.sliderWrap).length) {
27
+ $(el.sliderWrap).on(
28
+ 'scroll',
29
+ _.debounce(() => handleScroll(el.sliderWrap), 100)
30
+ );
31
+ }
19
32
  },
20
33
  onClose: function () {
21
34
  Wick.MiniBasketSliderFE.cartEntries = [];
@@ -61,14 +61,6 @@ Wick.VatToggle = {
61
61
  return !!Wick.VatToggle.getCookie(Wick.VatToggle.VAT_COOKIE);
62
62
  },
63
63
 
64
- isActive: function () {
65
- if (Wick.VatToggle.getSwitcherState() !== null) {
66
- return Wick.VatToggle.getSwitcherState();
67
- } else {
68
- return Wick.VatToggle.isOn();
69
- }
70
- },
71
-
72
64
  toggleDisplayClass: function () {
73
65
  const includingVatEl = Wick.VatToggle.el.includingVat;
74
66
  const excludingVat = Wick.VatToggle.el.excludingVat;
@@ -82,8 +74,14 @@ Wick.VatToggle = {
82
74
  const excludingVatEl = Wick.VatToggle.el.excludingVat;
83
75
  const hiddenClassName = Wick.VatToggle.HIDDEN_CLASS_NAME;
84
76
 
77
+ let vatState = null;
78
+
85
79
  // check switcher state for web or cookie for app
86
- const vatState = Wick.VatToggle.isActive();
80
+ if (Wick.VatToggle.getSwitcherState() !== null) {
81
+ vatState = Wick.VatToggle.getSwitcherState();
82
+ } else {
83
+ vatState = Wick.VatToggle.isOn();
84
+ }
87
85
 
88
86
  if (vatState) {
89
87
  $(includingVatEl).addClass(hiddenClassName);
@@ -20,9 +20,6 @@ Wick.BasketData = (function () {
20
20
  promotionsInfo: [
21
21
  {
22
22
  description: 'Spend over £10 and get £2 fixed discount',
23
- displayDescription: 'Spend over £10 and get £2 fixed discount',
24
- displayDescriptionExclusiveVat:
25
- 'Spend over £10 and get £1.67 fixed discount (ex. VAT)',
26
23
  usedCouponCode: 'RT_02',
27
24
  },
28
25
  ],
@@ -952,14 +949,7 @@ Wick.BasketData = (function () {
952
949
  potentialProductPromotions: [],
953
950
  appliedProductPromotions: [],
954
951
  appliedOrderPromotions: [],
955
- promotionsInfo: [
956
- {
957
- description: 'Spend over £10 and get £2 fixed discount',
958
- displayDescription: 'Spend over £10 and get £2 fixed discount',
959
- displayDescriptionExclusiveVat:
960
- 'Spend over £10 and get £1.67 fixed discount (ex. VAT)',
961
- },
962
- ],
952
+ promotionsInfo: null,
963
953
  clickAndCollectOnly: false,
964
954
  deliveryItemsQuantity: 1,
965
955
  pickupItemsQuantity: 2,
@@ -0,0 +1,132 @@
1
+ let addToCartResponseIndex = 0;
2
+
3
+ function formatBundlePrice(value) {
4
+ return new Intl.NumberFormat('en-GB', {
5
+ style: 'currency',
6
+ currency: 'GBP',
7
+ minimumFractionDigits: 2,
8
+ maximumFractionDigits: 2,
9
+ }).format(value);
10
+ }
11
+
12
+ function getPriceData(product) {
13
+ return product.price || product.displayPrice || {};
14
+ }
15
+
16
+ function getBundleProductPrice(product) {
17
+ const price = getPriceData(product);
18
+
19
+ return typeof price.value === 'number' ? price.value : 0;
20
+ }
21
+
22
+ function getBundleProductWasPrice(product) {
23
+ const price = getPriceData(product);
24
+
25
+ return typeof price.wasPrice === 'number' ? price.wasPrice : null;
26
+ }
27
+
28
+ function getBundleProductExcVatPrice(product) {
29
+ const priceExcVat = product.displayPriceExclusiveVat || product.priceExclusiveVat;
30
+ if (priceExcVat && typeof priceExcVat.value === 'number') return priceExcVat.value;
31
+ const price = getPriceData(product);
32
+ if (typeof price.value !== 'number') return 0;
33
+ const vatRate = price.vatRatePercentage || 20;
34
+ return price.value / (1 + vatRate / 100);
35
+ }
36
+
37
+ function getBundleProductExcVatWasPrice(product) {
38
+ const display = product.displayPriceExclusiveVat;
39
+ const raw = product.priceExclusiveVat;
40
+ if (display && typeof display.wasPrice === 'number') return display.wasPrice;
41
+ if (raw && typeof raw.wasPrice === 'number') return raw.wasPrice;
42
+ const price = getPriceData(product);
43
+ if (typeof price.wasPrice !== 'number') return null;
44
+ const vatRate = price.vatRatePercentage || 20;
45
+ return price.wasPrice / (1 + vatRate / 100);
46
+ }
47
+
48
+ function calculateBundleTotal(entries) {
49
+ let totalPrice = 0;
50
+ let totalWasPrice = 0;
51
+ let totalExcVatPrice = 0;
52
+ let totalExcVatWasPrice = 0;
53
+ let hasWasPrice = false;
54
+
55
+ entries.forEach(function (entry) {
56
+ const quantity = entry.quantity || 1;
57
+ const price = getBundleProductPrice(entry.product);
58
+ const wasPrice = getBundleProductWasPrice(entry.product);
59
+ const excVatPrice = getBundleProductExcVatPrice(entry.product);
60
+ const excVatWasPrice = getBundleProductExcVatWasPrice(entry.product);
61
+
62
+ totalPrice += price * quantity;
63
+ totalWasPrice += (wasPrice || price) * quantity;
64
+ totalExcVatPrice += excVatPrice * quantity;
65
+ totalExcVatWasPrice += (excVatWasPrice || excVatPrice) * quantity;
66
+
67
+ if (wasPrice) {
68
+ hasWasPrice = true;
69
+ }
70
+ });
71
+
72
+ return {
73
+ totalPrice: formatBundlePrice(totalPrice),
74
+ totalWasPrice: hasWasPrice ? formatBundlePrice(totalWasPrice) : null,
75
+ totalExcVatPrice: formatBundlePrice(totalExcVatPrice),
76
+ totalExcVatWasPrice: hasWasPrice ? formatBundlePrice(totalExcVatWasPrice) : null,
77
+ };
78
+ }
79
+
80
+ function bindCalculateProductBundleTotalEvent() {
81
+ $(window).on('calculateProductBundleTotal', function ({ detail: { payload, resolve } }) {
82
+ const entries = payload.entries || [];
83
+
84
+ setTimeout(function () {
85
+ resolve(calculateBundleTotal(entries));
86
+ }, 200);
87
+ });
88
+ }
89
+
90
+ function getAddProductBundleResponse() {
91
+ const responses = [
92
+ {
93
+ bulkAddToCartData: {
94
+ messageType: 'success',
95
+ messageText: 'Selected product(s) were added to basket',
96
+ },
97
+ },
98
+ {
99
+ bulkAddToCartData: {
100
+ messageType: 'warning',
101
+ messageText: 'Selected product(s) were partially added to basket',
102
+ },
103
+ },
104
+ {
105
+ bulkAddToCartData: {
106
+ messageType: 'error',
107
+ messageText: 'Selected product(s) were not added to basket',
108
+ },
109
+ },
110
+ ];
111
+
112
+ const response = responses[addToCartResponseIndex % responses.length];
113
+
114
+ addToCartResponseIndex++;
115
+
116
+ return response;
117
+ }
118
+
119
+ function bindAddProductBundleToCartEvent() {
120
+ $(window).on('bulkAddToCart', function ({ detail: { payload, resolve } }) {
121
+ const entries = payload.entries || [];
122
+
123
+ setTimeout(function () {
124
+ resolve(getAddProductBundleResponse(entries));
125
+ }, 1200);
126
+ });
127
+ }
128
+
129
+ $(document).ready(function () {
130
+ bindCalculateProductBundleTotalEvent();
131
+ bindAddProductBundleToCartEvent();
132
+ });
@@ -0,0 +1,11 @@
1
+ var Wick = window.Wick || {};
2
+
3
+ $(document).ready(function () {
4
+ window.setTimeout(function () {
5
+ const $container = $('[data-complete-widget]');
6
+ const contextKey = $container.data('context-key');
7
+ const payloadData = Wick.FEMock.dataBloomreach[contextKey];
8
+
9
+ Wick.BloomreachWidget.init(payloadData);
10
+ }, 3000);
11
+ });
@@ -19,9 +19,6 @@ Wick.CheckoutData = (function () {
19
19
  promotionsInfo: [
20
20
  {
21
21
  description: 'Spend over £10 and get £2 fixed discount',
22
- displayDescription: 'Spend over £10 and get £2 fixed discount',
23
- displayDescriptionExclusiveVat:
24
- 'Spend over £10 and get £1.67 fixed discount (ex. VAT)',
25
22
  usedCouponCode: 'RT_02',
26
23
  },
27
24
  ],