wickes-css2 2.112.0-develop.4 → 2.112.0-develop.7
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 +1 -1
- package/build/css/category-main.css +1 -1
- package/build/css/components/global-search.css +1 -1
- package/build/css/homepage-main.css +1 -1
- package/build/css/kitchen-plp-main.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/my-account-main-v2.css +1 -1
- package/build/css/my-account-main.css +1 -1
- package/build/css/pages/page_product-details-critical.css +1 -1
- package/build/css/pages/page_product-details.css +1 -1
- package/build/css/pdp-main-before-combine.css +1 -1
- package/build/css/pdp-main-critical.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/pdp-main.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/css/store-locator-main.css +1 -1
- package/build/js/basket.min.js +1 -1
- package/build/js/bloomreach-widget.min.js +1 -1
- package/build/js/emulation.min.js +664 -38
- package/build/js/page/basket-v2.js +29 -20
- package/build/js/page/bloomreach-widget/bloomreach-widget.js +250 -0
- package/build/js/page/{bloomreach-widget.js → bloomreach-widget/complete-your-project-widget.js} +205 -359
- package/build/js/page/bloomreach-widget/why-not-add-widget.js +198 -0
- package/package.json +1 -5
- package/src/components/bloomreach/complete-card.hbs +4 -32
- package/src/components/bloomreach/why-not-add-card-skeleton.hbs +14 -0
- package/src/components/bloomreach/why-not-add-card.hbs +73 -0
- package/src/components/bloomreach/why-not-add-content.hbs +41 -0
- package/src/components/bloomreach/why-not-add-skeleton.hbs +9 -0
- package/src/components/bloomreach/why-not-add.hbs +6 -0
- package/src/components/my-account/order.hbs +6 -1
- package/src/components/order-item.hbs +7 -7
- package/src/components/pdp-price-actions.hbs +2 -2
- package/src/components/potential-promotion.hbs +4 -4
- package/src/components/price-badges.hbs +12 -0
- package/src/components/price-block-v2.hbs +5 -12
- package/src/components/reviews-rating.hbs +22 -0
- package/src/components/share-list-modal-without-social-icons.hbs +2 -2
- package/src/components/share-list-modal.hbs +7 -3
- package/src/data/data_shopping-cart-v2.json +46 -2
- package/src/data/data_shopping-cart-with-energy.json +26 -2
- package/src/data/my-account/data_my-order.json +8 -0
- package/src/js/emulation/basket-data.js +312 -0
- package/src/js/emulation/bloomreach-widget-loading.js +2 -2
- package/src/js/emulation/mock.js +309 -0
- package/src/js/emulation/shopping-list.js +40 -49
- package/src/js/emulation/why-not-add-loading.js +11 -0
- package/src/js/emulation/why-not-add.js +28 -0
- package/src/js/page/basket-v2.js +29 -20
- package/src/js/page/bloomreach-widget/bloomreach-widget.js +250 -0
- package/src/js/page/{bloomreach-widget.js → bloomreach-widget/complete-your-project-widget.js} +205 -359
- package/src/js/page/bloomreach-widget/why-not-add-widget.js +198 -0
- package/src/page_product-details-bloomreach.html +1 -1
- package/src/page_product-details-with-global-search-v2.html +2 -1
- package/src/page_product-details-with-why-not-add-single.html +131 -0
- package/src/page_track-my-order-result.html +1 -0
- package/src/scss/components/_tradepro-discount-banner.scss +10 -14
- package/src/scss/components/bloomreach/_bloomreach.scss +3 -0
- package/src/scss/components/bloomreach/_complete-card.scss +0 -38
- package/src/scss/components/bloomreach/_reviews.scss +60 -0
- package/src/scss/components/bloomreach/_why-not-add-card.scss +223 -0
- package/src/scss/components/bloomreach/_why-not-add.scss +143 -0
- package/src/scss/components/global-search.scss +0 -6
- package/src/scss/pages/page_product-details-critical.scss +7 -0
- package/src/scss/pages/page_product-details.scss +7 -0
- package/src/sitemap.html +10 -4
package/src/js/emulation/mock.js
CHANGED
|
@@ -9,6 +9,315 @@ Wick.FEMock = {
|
|
|
9
9
|
);
|
|
10
10
|
},
|
|
11
11
|
dataBloomreach: {
|
|
12
|
+
whyNotAddRecommendationsSingle: {
|
|
13
|
+
recommendedProducts: [
|
|
14
|
+
{
|
|
15
|
+
baseProduct: {
|
|
16
|
+
code: '153731',
|
|
17
|
+
name: 'Wickes Trade Paint Roller Set - 9in',
|
|
18
|
+
url: '/Wickes-Trade-Paint-Roller-Set---9in/p/153731',
|
|
19
|
+
purchasable: true,
|
|
20
|
+
productType: 'ProductModel',
|
|
21
|
+
isBaseProduct: false,
|
|
22
|
+
availabilityRestriction: 'NO_RESTRICTIONS',
|
|
23
|
+
fulfilmentType: 'STANDARD',
|
|
24
|
+
stock: {
|
|
25
|
+
stockLevelStatus: {
|
|
26
|
+
code: 'inStock',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
fulfillmentAttributes: {
|
|
30
|
+
type: 'STANDARD',
|
|
31
|
+
},
|
|
32
|
+
images: [
|
|
33
|
+
{
|
|
34
|
+
imageType: 'PRIMARY',
|
|
35
|
+
format: 'product',
|
|
36
|
+
url: 'https://placehold.co/68x68?text=roller',
|
|
37
|
+
altText: 'Wickes Trade Paint Roller Set - 9in',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
externalAverageRating: 5,
|
|
41
|
+
externalReviewCount: 100,
|
|
42
|
+
displayPrice: {
|
|
43
|
+
currencyIso: 'GBP',
|
|
44
|
+
value: 9999,
|
|
45
|
+
priceType: 'BUY',
|
|
46
|
+
formattedValue: '£9,999.00',
|
|
47
|
+
formattedPriceWithoutCurrencySymbol: '16',
|
|
48
|
+
currencySymbol: '£',
|
|
49
|
+
vatRatePercentage: 20,
|
|
50
|
+
valueInPence: 999900,
|
|
51
|
+
wasPrice: 30,
|
|
52
|
+
},
|
|
53
|
+
displayPriceExclusiveVat: {
|
|
54
|
+
currencyIso: 'GBP',
|
|
55
|
+
value: 9998,
|
|
56
|
+
priceType: 'BUY',
|
|
57
|
+
formattedValue: '£9,998.00',
|
|
58
|
+
formattedPriceWithoutCurrencySymbol: '13.33',
|
|
59
|
+
currencySymbol: '£',
|
|
60
|
+
valueInPence: 999800,
|
|
61
|
+
wasPrice: 25,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
whyNotAddRecommendations: {
|
|
68
|
+
recommendedProducts: [
|
|
69
|
+
{
|
|
70
|
+
baseProduct: {
|
|
71
|
+
code: '153731',
|
|
72
|
+
name: 'Wickes Trade Paint Roller Set - 9in',
|
|
73
|
+
url: '/Wickes-Trade-Paint-Roller-Set---9in/p/153731',
|
|
74
|
+
purchasable: true,
|
|
75
|
+
productType: 'ProductModel',
|
|
76
|
+
isBaseProduct: false,
|
|
77
|
+
availabilityRestriction: 'NO_RESTRICTIONS',
|
|
78
|
+
fulfilmentType: 'STANDARD',
|
|
79
|
+
stock: {
|
|
80
|
+
stockLevelStatus: {
|
|
81
|
+
code: 'inStock',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
fulfillmentAttributes: {
|
|
85
|
+
type: 'STANDARD',
|
|
86
|
+
},
|
|
87
|
+
images: [
|
|
88
|
+
{
|
|
89
|
+
imageType: 'PRIMARY',
|
|
90
|
+
format: 'product',
|
|
91
|
+
url: 'https://placehold.co/68x68?text=roller',
|
|
92
|
+
altText: 'Wickes Trade Paint Roller Set - 9in',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
externalAverageRating: 5,
|
|
96
|
+
externalReviewCount: 100,
|
|
97
|
+
|
|
98
|
+
displayPrice: {
|
|
99
|
+
currencyIso: 'GBP',
|
|
100
|
+
value: 9999,
|
|
101
|
+
priceType: 'BUY',
|
|
102
|
+
formattedValue: '£9,999.00',
|
|
103
|
+
formattedPriceWithoutCurrencySymbol: '16',
|
|
104
|
+
currencySymbol: '£',
|
|
105
|
+
vatRatePercentage: 20,
|
|
106
|
+
valueInPence: 999900,
|
|
107
|
+
wasPrice: 3000,
|
|
108
|
+
},
|
|
109
|
+
displayPriceExclusiveVat: {
|
|
110
|
+
currencyIso: 'GBP',
|
|
111
|
+
value: 9998,
|
|
112
|
+
priceType: 'BUY',
|
|
113
|
+
formattedValue: '£9,998.00',
|
|
114
|
+
formattedPriceWithoutCurrencySymbol: '13.33',
|
|
115
|
+
currencySymbol: '£',
|
|
116
|
+
valueInPence: 999800,
|
|
117
|
+
wasPrice: 2500,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
baseProduct: {
|
|
123
|
+
code: '349137',
|
|
124
|
+
name: 'Wickes Microfibre Paint Roller Sleeve - 9in',
|
|
125
|
+
url: '/Wickes-Microfibre-Paint-Roller-Sleeve---9in/p/349137',
|
|
126
|
+
purchasable: true,
|
|
127
|
+
productType: 'ProductModel',
|
|
128
|
+
isBaseProduct: false,
|
|
129
|
+
availabilityRestriction: 'NO_RESTRICTIONS',
|
|
130
|
+
fulfilmentType: 'STANDARD',
|
|
131
|
+
stock: {
|
|
132
|
+
stockLevelStatus: {
|
|
133
|
+
code: 'inStock',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
fulfillmentAttributes: {
|
|
137
|
+
type: 'STANDARD',
|
|
138
|
+
},
|
|
139
|
+
images: [
|
|
140
|
+
{
|
|
141
|
+
imageType: 'PRIMARY',
|
|
142
|
+
format: 'product',
|
|
143
|
+
url: 'https://placehold.co/68x68?text=sleeve',
|
|
144
|
+
altText: 'Wickes Microfibre Paint Roller Sleeve - 9in',
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
externalAverageRating: 4.2,
|
|
148
|
+
externalReviewCount: 48,
|
|
149
|
+
displayPrice: {
|
|
150
|
+
currencyIso: 'GBP',
|
|
151
|
+
value: 9999,
|
|
152
|
+
priceType: 'BUY',
|
|
153
|
+
formattedValue: '£7.5220',
|
|
154
|
+
formattedPriceWithoutCurrencySymbol: '7.50',
|
|
155
|
+
currencySymbol: '£',
|
|
156
|
+
vatRatePercentage: 20,
|
|
157
|
+
valueInPence: 999900,
|
|
158
|
+
},
|
|
159
|
+
displayPriceExclusiveVat: {
|
|
160
|
+
currencyIso: 'GBP',
|
|
161
|
+
value: 9998,
|
|
162
|
+
priceType: 'BUY',
|
|
163
|
+
formattedValue: '£6.25',
|
|
164
|
+
formattedPriceWithoutCurrencySymbol: '6.25',
|
|
165
|
+
currencySymbol: '£',
|
|
166
|
+
valueInPence: 999800,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
baseProduct: {
|
|
172
|
+
code: '221048',
|
|
173
|
+
name: 'Wickes Paint Tray - 9in',
|
|
174
|
+
url: '/Wickes-Paint-Tray---9in/p/221048',
|
|
175
|
+
purchasable: true,
|
|
176
|
+
productType: 'ProductModel',
|
|
177
|
+
isBaseProduct: false,
|
|
178
|
+
availabilityRestriction: 'NO_RESTRICTIONS',
|
|
179
|
+
fulfilmentType: 'STANDARD',
|
|
180
|
+
stock: {
|
|
181
|
+
stockLevelStatus: {
|
|
182
|
+
code: 'inStock',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
fulfillmentAttributes: {
|
|
186
|
+
type: 'STANDARD',
|
|
187
|
+
},
|
|
188
|
+
images: [
|
|
189
|
+
{
|
|
190
|
+
imageType: 'PRIMARY',
|
|
191
|
+
format: 'product',
|
|
192
|
+
url: 'https://placehold.co/68x68?text=tray',
|
|
193
|
+
altText: 'Wickes Paint Tray - 9in',
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
externalAverageRating: 3.8,
|
|
197
|
+
externalReviewCount: 19,
|
|
198
|
+
displayPrice: {
|
|
199
|
+
currencyIso: 'GBP',
|
|
200
|
+
value: 4,
|
|
201
|
+
priceType: 'BUY',
|
|
202
|
+
formattedValue: '£4',
|
|
203
|
+
formattedPriceWithoutCurrencySymbol: '4',
|
|
204
|
+
currencySymbol: '£',
|
|
205
|
+
vatRatePercentage: 20,
|
|
206
|
+
valueInPence: 400,
|
|
207
|
+
},
|
|
208
|
+
displayPriceExclusiveVat: {
|
|
209
|
+
currencyIso: 'GBP',
|
|
210
|
+
value: 3.33,
|
|
211
|
+
priceType: 'BUY',
|
|
212
|
+
formattedValue: '£3.33',
|
|
213
|
+
formattedPriceWithoutCurrencySymbol: '3.33',
|
|
214
|
+
currencySymbol: '£',
|
|
215
|
+
valueInPence: 333,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
baseProduct: {
|
|
221
|
+
code: '654221',
|
|
222
|
+
name: 'Wickes Professional Masking Tape - 48mm x 50m',
|
|
223
|
+
url: '/Wickes-Professional-Masking-Tape---48mm-x-50m/p/654221',
|
|
224
|
+
purchasable: true,
|
|
225
|
+
productType: 'ProductModel',
|
|
226
|
+
isBaseProduct: false,
|
|
227
|
+
availabilityRestriction: 'NO_RESTRICTIONS',
|
|
228
|
+
fulfilmentType: 'STANDARD',
|
|
229
|
+
stock: {
|
|
230
|
+
stockLevelStatus: {
|
|
231
|
+
code: 'inStock',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
fulfillmentAttributes: {
|
|
235
|
+
type: 'STANDARD',
|
|
236
|
+
},
|
|
237
|
+
images: [
|
|
238
|
+
{
|
|
239
|
+
imageType: 'PRIMARY',
|
|
240
|
+
format: 'product',
|
|
241
|
+
url: 'https://placehold.co/68x68?text=tape',
|
|
242
|
+
altText: 'Wickes Professional Masking Tape - 48mm x 50m',
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
externalAverageRating: 4.6,
|
|
246
|
+
externalReviewCount: 72,
|
|
247
|
+
displayPrice: {
|
|
248
|
+
currencyIso: 'GBP',
|
|
249
|
+
value: 5.5,
|
|
250
|
+
priceType: 'BUY',
|
|
251
|
+
formattedValue: '£5.50',
|
|
252
|
+
formattedPriceWithoutCurrencySymbol: '5.50',
|
|
253
|
+
currencySymbol: '£',
|
|
254
|
+
vatRatePercentage: 20,
|
|
255
|
+
valueInPence: 550,
|
|
256
|
+
},
|
|
257
|
+
displayPriceExclusiveVat: {
|
|
258
|
+
currencyIso: 'GBP',
|
|
259
|
+
value: 4.58,
|
|
260
|
+
priceType: 'BUY',
|
|
261
|
+
formattedValue: '£4.58',
|
|
262
|
+
formattedPriceWithoutCurrencySymbol: '4.58',
|
|
263
|
+
currencySymbol: '£',
|
|
264
|
+
valueInPence: 458,
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
baseProduct: {
|
|
270
|
+
code: '782913',
|
|
271
|
+
name: 'Wickes Dust Sheet Cotton Twill - 3.6m x 2.7m Extra Long Product Name For Two Line Truncation Test',
|
|
272
|
+
url: '/Wickes-Dust-Sheet-Cotton-Twill---3-6m-x-2-7m/p/782913',
|
|
273
|
+
purchasable: true,
|
|
274
|
+
productType: 'ProductModel',
|
|
275
|
+
isBaseProduct: false,
|
|
276
|
+
availabilityRestriction: 'NO_RESTRICTIONS',
|
|
277
|
+
fulfilmentType: 'STANDARD',
|
|
278
|
+
stock: {
|
|
279
|
+
stockLevelStatus: {
|
|
280
|
+
code: 'inStock',
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
fulfillmentAttributes: {
|
|
284
|
+
type: 'STANDARD',
|
|
285
|
+
},
|
|
286
|
+
images: [
|
|
287
|
+
{
|
|
288
|
+
imageType: 'PRIMARY',
|
|
289
|
+
format: 'product',
|
|
290
|
+
url: 'https://placehold.co/68x68?text=sheet',
|
|
291
|
+
altText: 'Wickes Dust Sheet Cotton Twill - 3.6m x 2.7m',
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
externalAverageRating: 4.1,
|
|
295
|
+
externalReviewCount: 34,
|
|
296
|
+
displayPrice: {
|
|
297
|
+
currencyIso: 'GBP',
|
|
298
|
+
value: 12,
|
|
299
|
+
priceType: 'BUY',
|
|
300
|
+
formattedValue: '£12',
|
|
301
|
+
formattedPriceWithoutCurrencySymbol: '12',
|
|
302
|
+
currencySymbol: '£',
|
|
303
|
+
vatRatePercentage: 20,
|
|
304
|
+
valueInPence: 1200,
|
|
305
|
+
wasPrice: 18,
|
|
306
|
+
},
|
|
307
|
+
displayPriceExclusiveVat: {
|
|
308
|
+
currencyIso: 'GBP',
|
|
309
|
+
value: 10,
|
|
310
|
+
priceType: 'BUY',
|
|
311
|
+
formattedValue: '£10',
|
|
312
|
+
formattedPriceWithoutCurrencySymbol: '10',
|
|
313
|
+
currencySymbol: '£',
|
|
314
|
+
valueInPence: 1000,
|
|
315
|
+
wasPrice: 15,
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
],
|
|
320
|
+
},
|
|
12
321
|
completeYourProject3Recomendations: [
|
|
13
322
|
{
|
|
14
323
|
baseProduct: {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
2
|
|
|
3
3
|
Wick.ShoppingList = {
|
|
4
|
-
|
|
4
|
+
invalidEmailMessage: 'Please enter a valid email address',
|
|
5
|
+
|
|
6
|
+
bindAll: function () {
|
|
5
7
|
Wick.ShoppingList.bindButtons();
|
|
6
8
|
},
|
|
7
9
|
|
|
8
|
-
bindButtons
|
|
10
|
+
bindButtons: function () {
|
|
9
11
|
$('.btn-share-confirmation .btn-primary').on('click', function (e) {
|
|
10
12
|
e.preventDefault();
|
|
11
13
|
$('#share-via-email').prop('required', false);
|
|
@@ -13,7 +15,7 @@ Wick.ShoppingList = {
|
|
|
13
15
|
});
|
|
14
16
|
},
|
|
15
17
|
|
|
16
|
-
submitSharingShoppingList
|
|
18
|
+
submitSharingShoppingList: function () {
|
|
17
19
|
var forms = Wick.ShoppingList.getRecipientEmailsForms();
|
|
18
20
|
|
|
19
21
|
if (Wick.ShoppingList.isFormsValid(forms)) {
|
|
@@ -21,82 +23,71 @@ Wick.ShoppingList = {
|
|
|
21
23
|
}
|
|
22
24
|
},
|
|
23
25
|
|
|
24
|
-
onSuccessSharingShoppingList
|
|
26
|
+
onSuccessSharingShoppingList: function () {
|
|
25
27
|
Wick.ShoppingList.resetFormErrors();
|
|
26
28
|
},
|
|
27
29
|
|
|
28
|
-
getRecipientEmailsForms
|
|
30
|
+
getRecipientEmailsForms: function () {
|
|
29
31
|
var forms = new Array();
|
|
30
32
|
|
|
31
33
|
forms.push($('#share-via-email'));
|
|
32
34
|
$('.share-via-email-box').each(function () {
|
|
33
|
-
forms.push($(this).find('[
|
|
35
|
+
forms.push($(this).find('[name="share-list-modal"]'));
|
|
34
36
|
});
|
|
35
37
|
|
|
36
38
|
return forms;
|
|
37
39
|
},
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
clearValidationErrors: function (forms) {
|
|
42
|
+
forms.forEach(function (form) {
|
|
43
|
+
window.Wick.Validation.removeValidationError(form);
|
|
44
|
+
});
|
|
45
|
+
},
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
isFormsValid: function (forms) {
|
|
48
|
+
Wick.ShoppingList.clearValidationErrors(forms);
|
|
49
|
+
|
|
50
|
+
var oneFieldFilledIn = forms.some(function (form) {
|
|
51
|
+
return $(form).val() !== '';
|
|
46
52
|
});
|
|
47
53
|
|
|
48
54
|
if (!oneFieldFilledIn) {
|
|
49
|
-
Wick.
|
|
55
|
+
window.Wick.Validation.displayValidationError(
|
|
56
|
+
forms[0],
|
|
57
|
+
Wick.ShoppingList.invalidEmailMessage
|
|
58
|
+
);
|
|
50
59
|
return false;
|
|
51
60
|
}
|
|
52
61
|
|
|
53
62
|
var isFormsValid = true;
|
|
54
63
|
|
|
55
|
-
forms
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
forms
|
|
65
|
+
.filter(function (form) {
|
|
66
|
+
return $(form).val() !== '';
|
|
67
|
+
})
|
|
68
|
+
.forEach(function (form) {
|
|
69
|
+
if (window.Wick.Validation.isValidEmail($(form).val())) {
|
|
70
|
+
window.Wick.Validation.removeValidationError(form);
|
|
71
|
+
} else {
|
|
72
|
+
window.Wick.Validation.displayValidationError(
|
|
73
|
+
form,
|
|
74
|
+
Wick.ShoppingList.invalidEmailMessage
|
|
75
|
+
);
|
|
76
|
+
isFormsValid = false;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
62
79
|
|
|
63
80
|
return isFormsValid;
|
|
64
81
|
},
|
|
65
82
|
|
|
66
|
-
showEmptyFormsWarning : function (form) {
|
|
67
|
-
form.prop('required', true);
|
|
68
|
-
|
|
69
|
-
try {
|
|
70
|
-
form.get(0).reportValidity();
|
|
71
|
-
} catch (e) {
|
|
72
|
-
Wick.ShoppingList.resetFormErrors();
|
|
73
|
-
|
|
74
|
-
form.closest('.form-row').addClass('form-row_validation-error');
|
|
75
|
-
form.closest('.form-row__field').append('<div class="form-row__error">Please fill in the field</div>');
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
showInvalidEmailWarning : function (form) {
|
|
80
|
-
try {
|
|
81
|
-
form.get(0).reportValidity();
|
|
82
|
-
} catch (e) {
|
|
83
|
-
Wick.ShoppingList.resetFormErrors();
|
|
84
|
-
|
|
85
|
-
form.closest('.form-row').addClass('form-row_validation-error');
|
|
86
|
-
form.closest('.form-row__field').append('<div class="form-row__error">Please fill in the field</div>');
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
|
|
90
83
|
resetFormErrors: function () {
|
|
91
|
-
$('#share-list-form .form-row').each(function() {
|
|
84
|
+
$('#share-list-form .form-row').each(function () {
|
|
92
85
|
$(this).removeClass('form-row_validation-error');
|
|
93
86
|
$(this).find('.form-row__error').remove();
|
|
94
87
|
});
|
|
95
|
-
}
|
|
88
|
+
},
|
|
96
89
|
};
|
|
97
90
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
$(document).ready(function() {
|
|
91
|
+
$(document).ready(function () {
|
|
101
92
|
Wick.ShoppingList.bindAll();
|
|
102
93
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
$(document).ready(function () {
|
|
4
|
+
window.setTimeout(function () {
|
|
5
|
+
const $container = $('[data-why-not-add-widget]');
|
|
6
|
+
const mockDataKey = $container.data('mock-key');
|
|
7
|
+
const payloadData = Wick.FEMock.dataBloomreach[mockDataKey];
|
|
8
|
+
|
|
9
|
+
Wick.BloomreachWidget.init('whyNotAdd', payloadData);
|
|
10
|
+
}, 3000);
|
|
11
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
function simulateHybrisSendingHtml() {
|
|
4
|
+
const htmlFromHybris = Wick.FEMock.cartPDP;
|
|
5
|
+
|
|
6
|
+
window.dispatchEvent(
|
|
7
|
+
new CustomEvent('productAddedToCart', {
|
|
8
|
+
detail: {
|
|
9
|
+
html: htmlFromHybris,
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function bindWhyNotAddToCartEvent() {
|
|
16
|
+
$(window)
|
|
17
|
+
.off('addToCart.whyNotAddEmulation')
|
|
18
|
+
.on('addToCart.whyNotAddEmulation', function ({ detail: { resolve } }) {
|
|
19
|
+
setTimeout(function () {
|
|
20
|
+
resolve();
|
|
21
|
+
simulateHybrisSendingHtml();
|
|
22
|
+
}, 3000);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
$(document).ready(function () {
|
|
27
|
+
bindWhyNotAddToCartEvent();
|
|
28
|
+
});
|
package/src/js/page/basket-v2.js
CHANGED
|
@@ -277,13 +277,14 @@ Wick.BasketPage = {
|
|
|
277
277
|
if (isSwitchVat) {
|
|
278
278
|
const itemTotalIncVat = context.find(Wick.BasketPage.el.itemTotalIncVat);
|
|
279
279
|
const itemTotalExcVat = context.find(Wick.BasketPage.el.itemTotalExcVat);
|
|
280
|
-
const totalPrice = data.entry.
|
|
281
|
-
const totalPriceExcVat =
|
|
280
|
+
const totalPrice = data.entry.displayItemTotalWithoutDiscount.formattedValue;
|
|
281
|
+
const totalPriceExcVat =
|
|
282
|
+
data.entry.displayItemTotalWithoutDiscountExclusiveVat.formattedValue;
|
|
282
283
|
itemTotalIncVat.text(totalPrice);
|
|
283
284
|
itemTotalExcVat.text(totalPriceExcVat);
|
|
284
285
|
} else {
|
|
285
286
|
const totalValue = context.find(Wick.BasketPage.el.itemTotal);
|
|
286
|
-
const totalPrice = data.entry.
|
|
287
|
+
const totalPrice = data.entry.displayItemTotalWithoutDiscount.formattedValue;
|
|
287
288
|
totalValue.text(totalPrice);
|
|
288
289
|
}
|
|
289
290
|
}
|
|
@@ -798,20 +799,20 @@ Wick.BasketPage = {
|
|
|
798
799
|
<div class="order-item__price-title">Item price:</div>
|
|
799
800
|
<div class="order-item__price-value">
|
|
800
801
|
${
|
|
801
|
-
currentItem.
|
|
802
|
+
currentItem.displayBasePrice.value === 0
|
|
802
803
|
? '<span class="order-item__value">FREE</span>'
|
|
803
804
|
: Wick.VatToggle.isToggleVatAvailable()
|
|
804
805
|
? `
|
|
805
806
|
<div class="including-vat"><!--
|
|
806
|
-
--><span class="order-item__value">${currentItem.
|
|
807
|
+
--><span class="order-item__value">${currentItem.displayBasePrice.formattedValue}</span><!--
|
|
807
808
|
--><div class="price-vat">Inc.VAT</div>
|
|
808
809
|
</div>
|
|
809
810
|
<div class="excluding-vat"><!--
|
|
810
|
-
--><span class="order-item__value">${currentItem.
|
|
811
|
+
--><span class="order-item__value">${currentItem.displayBasePriceExclusiveVat.formattedValue}</span><!--
|
|
811
812
|
--><div class="price-vat">Exc.VAT</div>
|
|
812
813
|
</div>
|
|
813
814
|
`
|
|
814
|
-
: `<span class="order-item__value">${currentItem.
|
|
815
|
+
: `<span class="order-item__value">${currentItem.displayBasePrice.formattedValue}</span>`
|
|
815
816
|
}
|
|
816
817
|
</div>
|
|
817
818
|
</div>
|
|
@@ -820,20 +821,20 @@ Wick.BasketPage = {
|
|
|
820
821
|
<div class="order-item__total-title">Item total:</div>
|
|
821
822
|
<div class="order-item__total-value">
|
|
822
823
|
${
|
|
823
|
-
currentItem.
|
|
824
|
+
currentItem.displayItemTotalWithoutDiscount.value === 0
|
|
824
825
|
? '<span class="order-item__value">FREE</span>'
|
|
825
826
|
: Wick.VatToggle.isToggleVatAvailable()
|
|
826
827
|
? `
|
|
827
828
|
<div class="including-vat"><!--
|
|
828
|
-
--><span class="order-item__value">${currentItem.
|
|
829
|
+
--><span class="order-item__value">${currentItem.displayItemTotalWithoutDiscount.formattedValue}</span><!--
|
|
829
830
|
--><div class="price-vat">Inc.VAT</div><!--
|
|
830
831
|
--></div>
|
|
831
832
|
<div class="excluding-vat"><!--
|
|
832
|
-
--><span class="order-item__value">${currentItem.
|
|
833
|
+
--><span class="order-item__value">${currentItem.displayItemTotalWithoutDiscountExclusiveVat.formattedValue}</span><!--
|
|
833
834
|
--><div class="price-vat">Exc.VAT</div>
|
|
834
835
|
</div>
|
|
835
836
|
`
|
|
836
|
-
: `<span class="order-item__value">${currentItem.
|
|
837
|
+
: `<span class="order-item__value">${currentItem.displayItemTotalWithoutDiscount.formattedValue}</span>`
|
|
837
838
|
}
|
|
838
839
|
</div>
|
|
839
840
|
</div>
|
|
@@ -929,7 +930,7 @@ Wick.BasketPage = {
|
|
|
929
930
|
data.appliedProductPromotions &&
|
|
930
931
|
data.appliedProductPromotions.forEach((entry) => {
|
|
931
932
|
entry.consumedEntries.forEach((promo) => {
|
|
932
|
-
if (promo.orderEntryNumber === item.entryNumber && entry.
|
|
933
|
+
if (promo.orderEntryNumber === item.entryNumber && entry.displayDescription) {
|
|
933
934
|
if (arr.length) {
|
|
934
935
|
let duplicate = arr.every((el) => {
|
|
935
936
|
return el !== Wick.BasketPage.buildPromotion(entry);
|
|
@@ -1115,15 +1116,19 @@ Wick.BasketPage = {
|
|
|
1115
1116
|
const arr = [];
|
|
1116
1117
|
if (data.potentialOrderPromotions && data.potentialOrderPromotions.length) {
|
|
1117
1118
|
data.potentialOrderPromotions.forEach((promo) => {
|
|
1118
|
-
!promo.
|
|
1119
|
+
!promo.displayDescription ||
|
|
1119
1120
|
arr.push(`
|
|
1120
1121
|
<div class="p-promotion">
|
|
1121
1122
|
<div class="p-promotion__icon">
|
|
1122
1123
|
<i class="icon fas fa-gift"></i>
|
|
1123
1124
|
</div>
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1125
|
+
${
|
|
1126
|
+
Wick.VatToggle.isToggleVatAvailable() &&
|
|
1127
|
+
promo.displayDescriptionExclusiveVat
|
|
1128
|
+
? `<div class="p-promotion__description including-vat">${promo.displayDescription}</div>
|
|
1129
|
+
<div class="p-promotion__description excluding-vat d-none">${promo.displayDescriptionExclusiveVat}</div>`
|
|
1130
|
+
: `<div class="p-promotion__description">${promo.displayDescription}</div>`
|
|
1131
|
+
}
|
|
1127
1132
|
<div class="p-promotion__close">
|
|
1128
1133
|
<i class="icon fas fa-times"></i>
|
|
1129
1134
|
</div>
|
|
@@ -1134,15 +1139,19 @@ Wick.BasketPage = {
|
|
|
1134
1139
|
|
|
1135
1140
|
if (data.appliedOrderPromotions && data.appliedOrderPromotions.length) {
|
|
1136
1141
|
data.appliedOrderPromotions.forEach((promo) => {
|
|
1137
|
-
!promo.
|
|
1142
|
+
!promo.displayDescription ||
|
|
1138
1143
|
arr.push(`
|
|
1139
1144
|
<div class="p-promotion">
|
|
1140
1145
|
<div class="p-promotion__icon">
|
|
1141
1146
|
<i class="icon fas fa-gift"></i>
|
|
1142
1147
|
</div>
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1148
|
+
${
|
|
1149
|
+
Wick.VatToggle.isToggleVatAvailable() &&
|
|
1150
|
+
promo.displayDescriptionExclusiveVat
|
|
1151
|
+
? `<div class="p-promotion__description including-vat">${promo.displayDescription}</div>
|
|
1152
|
+
<div class="p-promotion__description excluding-vat d-none">${promo.displayDescriptionExclusiveVat}</div>`
|
|
1153
|
+
: `<div class="p-promotion__description">${promo.displayDescription}</div>`
|
|
1154
|
+
}
|
|
1146
1155
|
<div class="p-promotion__close">
|
|
1147
1156
|
<i class="icon fas fa-times"></i>
|
|
1148
1157
|
</div>
|