wickes-css2 2.113.0-develop.2 → 2.113.0-develop.5

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 (65) hide show
  1. package/build/css/pdp-main-before-combine.css +1 -1
  2. package/build/css/pdp-main-non-critical.css +1 -1
  3. package/build/css/pdp-main.css +1 -1
  4. package/build/js/basket.min.js +1 -1
  5. package/build/js/bloomreach-widget.min.js +1 -1
  6. package/build/js/bundle.min.js +1 -1
  7. package/build/js/checkout.min.js +1 -1
  8. package/build/js/emulation.min.js +360 -3222
  9. package/build/js/general.bundle.min.js +1 -1
  10. package/build/js/merged-checkout.min.js +1 -1
  11. package/build/js/page/bloomreach-widget/bloomreach-recommendation-carousel-widget.js +318 -0
  12. package/build/js/page/bloomreach-widget/bloomreach-widget-core.js +370 -0
  13. package/build/js/page/bloomreach-widget/bloomreach-widget-tracking.js +16 -13
  14. package/build/js/page/bloomreach-widget/bloomreach-widget.js +8 -237
  15. package/build/js/page/bloomreach-widget/complete-your-project/cards.js +308 -0
  16. package/build/js/page/bloomreach-widget/complete-your-project/config.js +60 -0
  17. package/build/js/page/bloomreach-widget/complete-your-project/model.js +140 -0
  18. package/build/js/page/bloomreach-widget/complete-your-project/presenter.js +69 -0
  19. package/build/js/page/bloomreach-widget/complete-your-project/quantity.js +80 -0
  20. package/build/js/page/bloomreach-widget/complete-your-project/view.js +179 -0
  21. package/build/js/page/bloomreach-widget/complete-your-project/widget.js +185 -0
  22. package/build/js/page/bloomreach-widget/dont-forget-widget.js +15 -0
  23. package/build/js/page/bloomreach-widget/why-not-add-widget.js +10 -228
  24. package/build/js/pdp.bundle.min.js +1 -1
  25. package/build/js/plp.bundle.min.js +1 -1
  26. package/build/js/project-list.min.js +1 -1
  27. package/package.json +1 -1
  28. package/src/components/base/button.hbs +7 -0
  29. package/src/components/bloomreach/complete-your-project-skeleton.hbs +21 -0
  30. package/src/components/bloomreach/complete-your-project.hbs +6 -21
  31. package/src/components/bloomreach/why-not-add-card-skeleton.hbs +2 -2
  32. package/src/components/bloomreach/why-not-add-card.hbs +79 -60
  33. package/src/components/bloomreach/why-not-add-content.hbs +3 -3
  34. package/src/components/bloomreach/why-not-add.hbs +1 -1
  35. package/src/js/components/general/cart-slider.js +41 -4
  36. package/src/js/emulation/complete-your-project-loading.js +16 -0
  37. package/src/js/emulation/custom-slider-emulation.js +21 -8
  38. package/src/js/emulation/dont-forget-loading.js +36 -0
  39. package/src/js/emulation/just-added-scenarios-emulation.js +131 -0
  40. package/src/js/emulation/mini-basket.js +34 -34
  41. package/src/js/emulation/mock.js +429 -4
  42. package/src/js/emulation/why-not-add-loading.js +14 -3
  43. package/src/js/emulation/why-not-add.js +12 -14
  44. package/src/js/page/bloomreach-widget/bloomreach-recommendation-carousel-widget.js +318 -0
  45. package/src/js/page/bloomreach-widget/bloomreach-widget-core.js +370 -0
  46. package/src/js/page/bloomreach-widget/bloomreach-widget-tracking.js +16 -13
  47. package/src/js/page/bloomreach-widget/bloomreach-widget.js +8 -237
  48. package/src/js/page/bloomreach-widget/complete-your-project/cards.js +308 -0
  49. package/src/js/page/bloomreach-widget/complete-your-project/config.js +60 -0
  50. package/src/js/page/bloomreach-widget/complete-your-project/model.js +140 -0
  51. package/src/js/page/bloomreach-widget/complete-your-project/presenter.js +69 -0
  52. package/src/js/page/bloomreach-widget/complete-your-project/quantity.js +80 -0
  53. package/src/js/page/bloomreach-widget/complete-your-project/view.js +179 -0
  54. package/src/js/page/bloomreach-widget/complete-your-project/widget.js +185 -0
  55. package/src/js/page/bloomreach-widget/dont-forget-widget.js +15 -0
  56. package/src/js/page/bloomreach-widget/why-not-add-widget.js +10 -228
  57. package/src/page_product-details-with-global-search-v2.html +4 -6
  58. package/src/page_product-details-with-why-not-add-single.html +1 -1
  59. package/src/scss/components/bloomreach/_bloomreach.scss +1 -0
  60. package/src/scss/components/bloomreach/_card-shared.scss +24 -0
  61. package/src/scss/components/bloomreach/_complete-card.scss +1 -9
  62. package/src/scss/components/bloomreach/_why-not-add-card.scss +137 -10
  63. package/src/scss/components/bloomreach/_why-not-add.scss +31 -2
  64. package/build/js/page/bloomreach-widget/complete-your-project-widget.js +0 -1100
  65. package/src/js/page/bloomreach-widget/complete-your-project-widget.js +0 -1100
@@ -9,10 +9,382 @@ Wick.FEMock = {
9
9
  );
10
10
  },
11
11
  dataBloomreach: {
12
+ dontForgetRecommendations: {
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
+ potentialPromotions: [
33
+ {
34
+ customAttributes: {
35
+ overlayText: '15% off',
36
+ overlayBackgroundColor: 'yellow',
37
+ overlayTextColor: 'gray',
38
+ },
39
+ },
40
+ ],
41
+ images: [
42
+ {
43
+ imageType: 'PRIMARY',
44
+ format: 'product',
45
+ url: 'https://placehold.co/68x68?text=roller',
46
+ altText: 'Wickes Trade Paint Roller Set - 9in',
47
+ },
48
+ ],
49
+ externalAverageRating: 5,
50
+ externalReviewCount: 100,
51
+ displayPrice: {
52
+ currencyIso: 'GBP',
53
+ value: 9999,
54
+ priceType: 'BUY',
55
+ formattedValue: '£9,999.00',
56
+ formattedPriceWithoutCurrencySymbol: '9999',
57
+ currencySymbol: '£',
58
+ vatRatePercentage: 20,
59
+ valueInPence: 999900,
60
+ wasPrice: 3000,
61
+ },
62
+ displayPriceExclusiveVat: {
63
+ currencyIso: 'GBP',
64
+ value: 9998,
65
+ priceType: 'BUY',
66
+ formattedValue: '£9,998.00',
67
+ formattedPriceWithoutCurrencySymbol: '9998',
68
+ currencySymbol: '£',
69
+ valueInPence: 999800,
70
+ wasPrice: 2500,
71
+ },
72
+ },
73
+ },
74
+ {
75
+ baseProduct: {
76
+ code: '349137',
77
+ name: 'Wickes Microfibre Paint Roller Sleeve - 9in',
78
+ url: '/Wickes-Microfibre-Paint-Roller-Sleeve---9in/p/349137',
79
+ purchasable: true,
80
+ productType: 'ProductModel',
81
+ isBaseProduct: false,
82
+ availabilityRestriction: 'NO_RESTRICTIONS',
83
+ fulfilmentType: 'STANDARD',
84
+ stock: {
85
+ stockLevelStatus: {
86
+ code: 'inStock',
87
+ },
88
+ },
89
+ fulfillmentAttributes: {
90
+ type: 'STANDARD',
91
+ },
92
+ potentialPromotions: [
93
+ {
94
+ customAttributes: {
95
+ overlayText: 'Multi-buy',
96
+ overlayBackgroundColor: 'green',
97
+ overlayTextColor: 'gray',
98
+ },
99
+ },
100
+ ],
101
+ images: [
102
+ {
103
+ imageType: 'PRIMARY',
104
+ format: 'product',
105
+ url: 'https://placehold.co/68x68?text=sleeve',
106
+ altText: 'Wickes Microfibre Paint Roller Sleeve - 9in',
107
+ },
108
+ ],
109
+ externalAverageRating: 4.2,
110
+ externalReviewCount: 48,
111
+ displayPrice: {
112
+ currencyIso: 'GBP',
113
+ value: 7.5,
114
+ priceType: 'BUY',
115
+ formattedValue: '£7.50',
116
+ formattedPriceWithoutCurrencySymbol: '7.50',
117
+ currencySymbol: '£',
118
+ vatRatePercentage: 20,
119
+ valueInPence: 750,
120
+ },
121
+ displayPriceExclusiveVat: {
122
+ currencyIso: 'GBP',
123
+ value: 6.25,
124
+ priceType: 'BUY',
125
+ formattedValue: '£6.25',
126
+ formattedPriceWithoutCurrencySymbol: '6.25',
127
+ currencySymbol: '£',
128
+ valueInPence: 625,
129
+ },
130
+ },
131
+ },
132
+ {
133
+ baseProduct: {
134
+ code: '221048',
135
+ name: 'Wickes Paint Tray - 9in',
136
+ url: '/Wickes-Paint-Tray---9in/p/221048',
137
+ purchasable: true,
138
+ productType: 'ProductModel',
139
+ isBaseProduct: false,
140
+ availabilityRestriction: 'NO_RESTRICTIONS',
141
+ fulfilmentType: 'STANDARD',
142
+ stock: {
143
+ stockLevelStatus: {
144
+ code: 'inStock',
145
+ },
146
+ },
147
+ fulfillmentAttributes: {
148
+ type: 'STANDARD',
149
+ },
150
+ potentialPromotions: [
151
+ {
152
+ customAttributes: {
153
+ overlayText: 'Offer Ends Wednesday',
154
+ overlayBackgroundColor: 'red',
155
+ overlayTextColor: 'white',
156
+ },
157
+ },
158
+ ],
159
+ images: [
160
+ {
161
+ imageType: 'PRIMARY',
162
+ format: 'product',
163
+ url: 'https://placehold.co/68x68?text=tray',
164
+ altText: 'Wickes Paint Tray - 9in',
165
+ },
166
+ ],
167
+ externalAverageRating: 3.8,
168
+ externalReviewCount: 19,
169
+ displayPrice: {
170
+ currencyIso: 'GBP',
171
+ value: 4,
172
+ priceType: 'BUY',
173
+ formattedValue: '£4',
174
+ formattedPriceWithoutCurrencySymbol: '4',
175
+ currencySymbol: '£',
176
+ vatRatePercentage: 20,
177
+ valueInPence: 400,
178
+ },
179
+ displayPriceExclusiveVat: {
180
+ currencyIso: 'GBP',
181
+ value: 3.33,
182
+ priceType: 'BUY',
183
+ formattedValue: '£3.33',
184
+ formattedPriceWithoutCurrencySymbol: '3.33',
185
+ currencySymbol: '£',
186
+ valueInPence: 333,
187
+ },
188
+ },
189
+ },
190
+ {
191
+ baseProduct: {
192
+ code: '654221',
193
+ name: 'Wickes Professional Masking Tape - 48mm x 50m',
194
+ url: '/Wickes-Professional-Masking-Tape---48mm-x-50m/p/654221',
195
+ purchasable: true,
196
+ productType: 'ProductModel',
197
+ isBaseProduct: false,
198
+ availabilityRestriction: 'NO_RESTRICTIONS',
199
+ fulfilmentType: 'STANDARD',
200
+ stock: {
201
+ stockLevelStatus: {
202
+ code: 'inStock',
203
+ },
204
+ },
205
+ fulfillmentAttributes: {
206
+ type: 'STANDARD',
207
+ },
208
+ potentialPromotions: [
209
+ {
210
+ customAttributes: {
211
+ overlayText: 'Online Only',
212
+ overlayBackgroundColor: 'blue',
213
+ overlayTextColor: 'white',
214
+ },
215
+ },
216
+ ],
217
+ images: [
218
+ {
219
+ imageType: 'PRIMARY',
220
+ format: 'product',
221
+ url: 'https://placehold.co/68x68?text=tape',
222
+ altText: 'Wickes Professional Masking Tape - 48mm x 50m',
223
+ },
224
+ ],
225
+ externalAverageRating: 4.6,
226
+ externalReviewCount: 72,
227
+ displayPrice: {
228
+ currencyIso: 'GBP',
229
+ value: 5.5,
230
+ priceType: 'BUY',
231
+ formattedValue: '£5.50',
232
+ formattedPriceWithoutCurrencySymbol: '5.50',
233
+ currencySymbol: '£',
234
+ vatRatePercentage: 20,
235
+ valueInPence: 550,
236
+ },
237
+ displayPriceExclusiveVat: {
238
+ currencyIso: 'GBP',
239
+ value: 4.58,
240
+ priceType: 'BUY',
241
+ formattedValue: '£4.58',
242
+ formattedPriceWithoutCurrencySymbol: '4.58',
243
+ currencySymbol: '£',
244
+ valueInPence: 458,
245
+ },
246
+ },
247
+ },
248
+ {
249
+ baseProduct: {
250
+ code: '782913',
251
+ name: 'Wickes Dust Sheet Cotton Twill - 3.6m x 2.7m Extra Long Product Name For Two Line Truncation Test',
252
+ url: '/Wickes-Dust-Sheet-Cotton-Twill---3-6m-x-2-7m/p/782913',
253
+ purchasable: true,
254
+ productType: 'ProductModel',
255
+ isBaseProduct: false,
256
+ availabilityRestriction: 'NO_RESTRICTIONS',
257
+ fulfilmentType: 'STANDARD',
258
+ stock: {
259
+ stockLevelStatus: {
260
+ code: 'inStock',
261
+ },
262
+ },
263
+ fulfillmentAttributes: {
264
+ type: 'STANDARD',
265
+ },
266
+ potentialPromotions: [
267
+ {
268
+ customAttributes: {
269
+ overlayText: 'Clearance',
270
+ overlayBackgroundColor: 'gray',
271
+ overlayTextColor: 'white',
272
+ },
273
+ },
274
+ ],
275
+ images: [
276
+ {
277
+ imageType: 'PRIMARY',
278
+ format: 'product',
279
+ url: 'https://placehold.co/68x68?text=sheet',
280
+ altText: 'Wickes Dust Sheet Cotton Twill - 3.6m x 2.7m',
281
+ },
282
+ ],
283
+ externalAverageRating: 4.1,
284
+ externalReviewCount: 34,
285
+ displayPrice: {
286
+ currencyIso: 'GBP',
287
+ value: 12,
288
+ priceType: 'BUY',
289
+ formattedValue: '£12',
290
+ formattedPriceWithoutCurrencySymbol: '12',
291
+ currencySymbol: '£',
292
+ vatRatePercentage: 20,
293
+ valueInPence: 1200,
294
+ wasPrice: 18,
295
+ },
296
+ displayPriceExclusiveVat: {
297
+ currencyIso: 'GBP',
298
+ value: 10,
299
+ priceType: 'BUY',
300
+ formattedValue: '£10',
301
+ formattedPriceWithoutCurrencySymbol: '10',
302
+ currencySymbol: '£',
303
+ valueInPence: 1000,
304
+ wasPrice: 15,
305
+ },
306
+ },
307
+ },
308
+ ],
309
+ widgetMetadata: {
310
+ responseId: 'mock-df-response',
311
+ id: 'df12345',
312
+ type: 'df',
313
+ },
314
+ },
315
+ dontForgetRecommendationsSingle: {
316
+ recommendedProducts: [
317
+ {
318
+ baseProduct: {
319
+ code: '153731',
320
+ name: 'Wickes Trade Paint Roller Set - 9in',
321
+ url: '/Wickes-Trade-Paint-Roller-Set---9in/p/153731',
322
+ purchasable: true,
323
+ productType: 'ProductModel',
324
+ isBaseProduct: false,
325
+ availabilityRestriction: 'NO_RESTRICTIONS',
326
+ fulfilmentType: 'STANDARD',
327
+ stock: {
328
+ stockLevelStatus: {
329
+ code: 'inStock',
330
+ },
331
+ },
332
+ fulfillmentAttributes: {
333
+ type: 'STANDARD',
334
+ },
335
+ potentialPromotions: [
336
+ {
337
+ customAttributes: {
338
+ overlayText: '15% off',
339
+ overlayBackgroundColor: 'yellow',
340
+ overlayTextColor: 'gray',
341
+ },
342
+ },
343
+ ],
344
+ images: [
345
+ {
346
+ imageType: 'PRIMARY',
347
+ format: 'product',
348
+ url: 'https://placehold.co/68x68?text=roller',
349
+ altText: 'Wickes Trade Paint Roller Set - 9in',
350
+ },
351
+ ],
352
+ externalAverageRating: 5,
353
+ externalReviewCount: 100,
354
+ displayPrice: {
355
+ currencyIso: 'GBP',
356
+ value: 9999,
357
+ priceType: 'BUY',
358
+ formattedValue: '£9,999.00',
359
+ formattedPriceWithoutCurrencySymbol: '9999',
360
+ currencySymbol: '£',
361
+ vatRatePercentage: 20,
362
+ valueInPence: 999900,
363
+ wasPrice: 3000,
364
+ },
365
+ displayPriceExclusiveVat: {
366
+ currencyIso: 'GBP',
367
+ value: 9998,
368
+ priceType: 'BUY',
369
+ formattedValue: '£9,998.00',
370
+ formattedPriceWithoutCurrencySymbol: '9998',
371
+ currencySymbol: '£',
372
+ valueInPence: 999800,
373
+ wasPrice: 2500,
374
+ },
375
+ },
376
+ },
377
+ ],
378
+ widgetMetadata: {
379
+ responseId: 'mock-df-single-response',
380
+ id: 'dfSingle12345',
381
+ type: 'df',
382
+ },
383
+ },
12
384
  whyNotAddRecommendationsSingle: {
13
385
  widgetMetadata: {
14
386
  responseId: 'mock-wna-single-response',
15
- id: 'wna12345',
387
+ id: 'wnaSingle12345',
16
388
  type: 'wna',
17
389
  },
18
390
  recommendedProducts: [
@@ -3495,7 +3867,7 @@ Wick.FEMock = {
3495
3867
  },
3496
3868
  ],
3497
3869
  cartPDP: `
3498
- <div class="custom-slider__wrap slider-mini-basket popover-mini-basket">
3870
+ <div class="custom-slider__wrap slider-mini-basket popover-mini-basket" data-mock-key="dontForgetRecommendations">
3499
3871
  <div class="custom-slider__header">
3500
3872
  <a href="#" type="button" class="link close-popup">
3501
3873
  <span class="icon-wrap">
@@ -3544,8 +3916,61 @@ Wick.FEMock = {
3544
3916
  </div>
3545
3917
  </div>
3546
3918
  </div>
3547
- <div class="custom-slider__content">
3548
- <p>Product description Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus pronin sapien nunc accuan eget. Product description Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar sic tempor. Sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus pronin sapien nunc accuan eget.</p>
3919
+ </div>
3920
+ <div class="custom-slider__footer">
3921
+ <button class="btn btn_full btn-secondary close-popup">Continue Shopping</button>
3922
+ <a href="/cart" class="btn btn-action btn_full btn-view-basket-cta" type="button">View Basket</a>
3923
+ </div>
3924
+ `,
3925
+ cartPDPSingle: `
3926
+ <div class="custom-slider__wrap slider-mini-basket popover-mini-basket" data-mock-key="dontForgetRecommendationsSingle">
3927
+ <div class="custom-slider__header">
3928
+ <a href="#" type="button" class="link close-popup">
3929
+ <span class="icon-wrap">
3930
+ <svg class="svg-inline--fa fa-angle-left fa-w-6" aria-hidden="true" focusable="false" data-prefix="far" data-icon="angle-left" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512" data-fa-i2svg="">
3931
+ <path fill="currentColor" d="M4.2 247.5L151 99.5c4.7-4.7 12.3-4.7 17 0l19.8 19.8c4.7 4.7 4.7 12.3 0 17L69.3 256l118.5 119.7c4.7 4.7 4.7 12.3 0 17L168 412.5c-4.7 4.7-12.3 4.7-17 0L4.2 264.5c-4.7-4.7-4.7-12.3 0-17z"></path>
3932
+ </svg>
3933
+ </span>
3934
+ Continue Shopping
3935
+ </a>
3936
+ <a href="#" type="button" class="icon-wrap close-popup">
3937
+ <svg class="svg-inline--fa fa-times fa-w-10 icon" aria-hidden="true" focusable="false" data-prefix="far" data-icon="times" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" data-fa-i2svg="">
3938
+ <path fill="currentColor" d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"></path>
3939
+ </svg>
3940
+ </a>
3941
+ </div>
3942
+ <div class="custom-slider__message">
3943
+ <span class="icon-wrap success">
3944
+ <svg class="svg-inline--fa fa-check-circle fa-w-16" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg><!-- <i class="fas fa-check-circle"></i> Font Awesome fontawesome.com -->
3945
+ </span>
3946
+
3947
+ <div class="messages popover-mini-basket__added">
3948
+ <p class="messages__text">
3949
+ <span>
3950
+ You've just added</span>
3951
+ </p>
3952
+
3953
+ <span class="messages__notice">
3954
+ Excluding items already in basket</span>
3955
+ </div>
3956
+ </div>
3957
+ <div class="products popover-mini-basket__cards-holder">
3958
+ <div class="card product-card-preview">
3959
+ <div class="products__item card__inner" data-name="Blue Circle Ready To Use Postcrete - 20kg" data-id="221100" data-price="7.50" data-brand="Blue Circle" data-category="Building Materials/Cement &amp; Aggregates/Cement" data-position="0">
3960
+ <a href="/Blue-Circle-Ready-To-Use-Postcrete---20kg/p/221100" class="card__img-wrap card__img-wrap_link products__image">
3961
+ <img loading="lazy" class="product-img" src="//media.wickes.co.uk/is/image/wickes/B3182_221100_00?$thumbnail$" alt="Blue Circle Ready To Use Postcrete - 20kg" title="Blue Circle Ready To Use Postcrete - 20kg">
3962
+ </a>
3963
+
3964
+ <div class="products__details">
3965
+ <a href="/Blue-Circle-Ready-To-Use-Postcrete---20kg/p/221100" class="title product-card__title">Blue Circle Ready To Use Postcrete - 20kg</a>
3966
+ <p class="item">Added for delivery</p>
3967
+ <p class="item pdp-price__control-holder">Qty:
3968
+ <span class="value product-card__quantity-value">1</span>
3969
+ </p>
3970
+ <p class="price product-card__price-value">£7.50</p>
3971
+ </div>
3972
+ </div>
3973
+ </div>
3549
3974
  </div>
3550
3975
  </div>
3551
3976
  <div class="custom-slider__footer">
@@ -2,9 +2,20 @@ var Wick = window.Wick || {};
2
2
 
3
3
  $(document).ready(function () {
4
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];
5
+ const $container = $('[data-why-not-add-widget]').first();
6
+
7
+ if (!$container.length) {
8
+ return;
9
+ }
10
+
11
+ const mockDataKey = $container.attr('data-mock-key');
12
+ const payloadData =
13
+ Wick.FEMock && Wick.FEMock.dataBloomreach && Wick.FEMock.dataBloomreach[mockDataKey];
14
+
15
+ if (!payloadData) {
16
+ $container.empty().hide();
17
+ return;
18
+ }
8
19
 
9
20
  Wick.BloomreachWidget.init('whyNotAdd', payloadData);
10
21
  }, 3000);
@@ -1,24 +1,22 @@
1
1
  var Wick = window.Wick || {};
2
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
- }
3
+ import { getNextCartAddScenario, dispatchCartScenario } from './just-added-scenarios-emulation';
14
4
 
15
5
  function bindWhyNotAddToCartEvent() {
16
6
  $(window)
17
7
  .off('addToCart.whyNotAddEmulation')
18
- .on('addToCart.whyNotAddEmulation', function ({ detail: { resolve } }) {
19
- setTimeout(function () {
8
+ .on('addToCart.whyNotAddEmulation', function ({ detail }) {
9
+ const { payload, resolve } = detail;
10
+
11
+ if (payload && payload.doNotShowAddedProductPopup === true) {
12
+ return;
13
+ }
14
+
15
+ const scenario = getNextCartAddScenario();
16
+
17
+ window.setTimeout(function () {
20
18
  resolve();
21
- simulateHybrisSendingHtml();
19
+ dispatchCartScenario(Wick.FEMock.cartPDP, scenario);
22
20
  }, 3000);
23
21
  });
24
22
  }