wickes-css2 2.113.0 → 2.116.0
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/checkout-payment-details-v2.css +1 -1
- package/build/css/components/checkout-payment-repayment-terms.css +1 -1
- package/build/css/components/price-block-v2-critical.css +1 -1
- package/build/css/components/price-block-v2.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/checkout-new.css +1 -1
- package/build/css/pages/checkout.css +1 -1
- package/build/css/pages/page_checkout_delivery-new.css +1 -1
- package/build/css/pages/page_product-details-v2-critical.css +1 -1
- package/build/css/pages/page_product-details-v2.css +1 -1
- package/build/css/pages/page_product-details.css +1 -1
- package/build/css/pages/page_products-list-combined.css +1 -1
- package/build/css/pages/page_products-list_v2.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/account-members.min.js +1 -1
- package/build/js/add-project-list-id.min.js +1 -1
- package/build/js/address-book.min.js +1 -1
- package/build/js/basket.min.js +2 -2
- package/build/js/bloomreach-widget.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/change-password.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/emulation.min.js +260 -192
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/gift-cards.min.js +1 -1
- package/build/js/kitchen/kitchen-plp.min.js +1 -1
- package/build/js/merged-checkout.min.js +2 -2
- package/build/js/package-bulk-add.min.js +1 -0
- package/build/js/page/bloomreach-widget/bloomreach-recommendation-carousel-widget.js +7 -6
- package/build/js/page/bloomreach-widget/bloomreach-widget-core.js +47 -27
- package/build/js/page/bloomreach-widget/bloomreach-widget.js +5 -0
- package/build/js/page/bloomreach-widget/complete-your-project/view.js +11 -6
- package/build/js/page/bloomreach-widget/complete-your-project/widget.js +0 -1
- package/build/js/page/bloomreach-widget/similar-products-widget.js +17 -0
- package/build/js/page/plp-load-more.js +81 -66
- package/build/js/page/ripple/bulk-add.js +71 -0
- package/build/js/page/ripple/package-bulk-add.js +43 -0
- package/build/js/page/ripple/postcode-checker.js +83 -0
- package/build/js/page/ripple/thumb-gallery.js +236 -0
- package/build/js/page/utils/validation.js +1 -1
- package/build/js/pdp.bundle.min.js +2 -2
- package/build/js/personal-details.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/postcode-checker.min.js +1 -0
- package/build/js/project-list.min.js +2 -2
- package/build/js/quiz.min.js +1 -1
- package/build/js/track-my-order.min.js +1 -1
- package/package.json +1 -1
- package/src/badges-ripple.html +120 -0
- package/src/badges.html +9 -18
- package/src/components/bloomreach/complete-card.hbs +1 -1
- package/src/components/bloomreach/why-not-add-card.hbs +26 -7
- package/src/components/bloomreach/why-not-add.hbs +1 -1
- package/src/components/fulfilment-accordions.hbs +1 -1
- package/src/components/image-accordion.hbs +18 -0
- package/src/components/kitchen/price.hbs +49 -29
- package/src/components/kitchen/strip-stickers.hbs +9 -3
- package/src/components/package-card.hbs +30 -0
- package/src/components/pdp-price-actions.hbs +17 -0
- package/src/components/postcode-checker.hbs +24 -0
- package/src/components/price-badges.hbs +12 -10
- package/src/components/price-block-v2.hbs +289 -199
- package/src/components/product-main-info-v2.hbs +2 -0
- package/src/components/suite-includes.hbs +66 -0
- package/src/components/suite-product-card.hbs +47 -0
- package/src/components/thumb-gallery.hbs +23 -0
- package/src/data/data_badges.json +143 -0
- package/src/data/data_bathroom-plp.json +814 -0
- package/src/data/data_suite-includes-products.json +134 -0
- package/src/js/components/banner-placement-manager.js +25 -9
- package/src/js/components/general/image-accordion.js +54 -0
- package/src/js/components/general/switchVat.js +8 -1
- package/src/js/components/package-card.js +69 -0
- package/src/js/components/store-locator-cards.js +76 -0
- package/src/js/emulation/banner-placement-manager.js +219 -188
- package/src/js/emulation/bloomreach-widget-calculations.js +1 -1
- package/src/js/emulation/mock.js +66 -34
- package/src/js/emulation/plp-load-more.js +13 -4
- package/src/js/emulation/postcode-checker.js +11 -0
- package/src/js/emulation/similar-products-loading.js +22 -0
- package/src/js/page/bloomreach-widget/bloomreach-recommendation-carousel-widget.js +7 -6
- package/src/js/page/bloomreach-widget/bloomreach-widget-core.js +47 -27
- package/src/js/page/bloomreach-widget/bloomreach-widget.js +5 -0
- package/src/js/page/bloomreach-widget/complete-your-project/view.js +11 -6
- package/src/js/page/bloomreach-widget/complete-your-project/widget.js +0 -1
- package/src/js/page/bloomreach-widget/similar-products-widget.js +17 -0
- package/src/js/page/plp-load-more.js +81 -66
- package/src/js/page/ripple/bulk-add.js +71 -0
- package/src/js/page/ripple/package-bulk-add.js +43 -0
- package/src/js/page/ripple/postcode-checker.js +83 -0
- package/src/js/page/ripple/thumb-gallery.js +236 -0
- package/src/js/page/utils/validation.js +1 -1
- package/src/page_bathroom-plp-vat.html +81 -0
- package/src/page_bathroom-plp-without-load-more.html +83 -0
- package/src/page_bathroom-plp.html +98 -0
- package/src/page_checkout_delivery-details-v2-calendar-not-loaded.html +167 -0
- package/src/page_checkout_payment-details-v2-asm.html +2 -3
- package/src/page_checkout_payment-details-v2.html +2 -3
- package/src/page_checkout_payment-details_with-card-loader.html +2 -3
- package/src/page_checkout_payment-details_with-klarna-loader.html +2 -3
- package/src/page_checkout_payment-details_with-loader-v2.html +2 -3
- package/src/page_klarna_payment-details_with-klarna.html +2 -3
- package/src/page_payment-details-billie-registered-only.html +2 -3
- package/src/page_payment-details-billie-unregistered-only.html +2 -3
- package/src/page_payment-details-with-billie.html +2 -3
- package/src/page_payment-details-with-clearpay.html +2 -3
- package/src/page_payment-details-with-gift-card.html +2 -3
- package/src/page_payment-details_with_apple-pay.html +0 -1
- package/src/page_payment-details_with_google-pay.html +2 -3
- package/src/page_product-details-banner.html +1 -3
- package/src/page_product-details-big-wins-disabled-delivery.html +1 -3
- package/src/page_product-details-big-wins-non-registered.html +1 -3
- package/src/page_product-details-big-wins-out-nearest.html +1 -3
- package/src/page_product-details-big-wins-unhappy.html +1 -3
- package/src/page_product-details-big-wins.html +1 -3
- package/src/page_product-details-billie.html +1 -3
- package/src/page_product-details-calculator.html +1 -3
- package/src/page_product-details-cashback-v2.html +1 -3
- package/src/page_product-details-clearpay.html +1 -3
- package/src/page_product-details-cnc-error-notification.html +1 -3
- package/src/page_product-details-cnc-success-notification-vat.html +1 -4
- package/src/page_product-details-cnc-success-notification.html +1 -3
- package/src/page_product-details-default-store.html +1 -3
- package/src/page_product-details-energy-efficiency.html +1 -3
- package/src/page_product-details-flooring-with-pr-placeholder.html +1 -3
- package/src/page_product-details-flooring.html +1 -3
- package/src/page_product-details-gallery-actual.html +1 -3
- package/src/page_product-details-mfe-calculator.html +1 -3
- package/src/page_product-details-mtm-doors.html +1 -3
- package/src/page_product-details-only-clearpay.html +1 -3
- package/src/page_product-details-paint-mixing.html +1 -3
- package/src/page_product-details-ripple-gallery-1-image.html +120 -0
- package/src/page_product-details-ripple-gallery-missing-image.html +121 -0
- package/src/page_product-details-ripple-gallery.html +121 -0
- package/src/page_product-details-saved-pl.html +1 -3
- package/src/page_product-details-suite-includes-banners.html +139 -0
- package/src/page_product-details-suite-includes-billie.html +128 -0
- package/src/page_product-details-suite-includes-klarna.html +120 -0
- package/src/page_product-details-suite-includes-vat.html +126 -0
- package/src/page_product-details-suite-includes.html +122 -0
- package/src/page_product-details-tile-steps-klarna-widget-with-method-ids.html +1 -3
- package/src/page_product-details-tile-steps-logout.html +1 -3
- package/src/page_product-details-tile-steps-no-new-project-list.html +1 -3
- package/src/page_product-details-tile-steps-with-klarna.html +1 -3
- package/src/page_product-details-tile-steps.html +1 -3
- package/src/page_product-details-v2.html +1 -3
- package/src/page_product-details-vat.html +1 -3
- package/src/page_product-details-wisdom-mcfc-registered.html +1 -3
- package/src/page_product-details-wisdom-mcfc.html +1 -3
- package/src/page_product-details-wisdom-oos-registered.html +1 -3
- package/src/page_product-details-wisdom-oos.html +1 -3
- package/src/page_product-details-wisdom-registered.html +1 -3
- package/src/page_product-details-wisdom.html +1 -3
- package/src/page_product-details-with-favourite.html +1 -3
- package/src/page_product-details-with-global-search-v2.html +2 -3
- package/src/page_product-details-with-similar-products-widget.html +132 -0
- package/src/page_product-details-with-why-not-add-single.html +1 -0
- package/src/page_product-details_no-previous-default.html +1 -3
- package/src/scss/common/_loading-button.scss +3 -1
- package/src/scss/components/_date-selection-add-new-styles.scss +53 -3
- package/src/scss/components/_gift-cards.scss +1 -1
- package/src/scss/components/_image-accordion.scss +54 -0
- package/src/scss/components/_kitchen-card.scss +1 -0
- package/src/scss/components/_map.scss +38 -0
- package/src/scss/components/_package-card.scss +65 -0
- package/src/scss/components/_package-plp.scss +88 -0
- package/src/scss/components/_postcode-checker.scss +115 -0
- package/src/scss/components/_price-badges-critical.scss +10 -0
- package/src/scss/components/_price-badges.scss +10 -0
- package/src/scss/components/_price-block-critical.scss +1 -0
- package/src/scss/components/_price-block.scss +1 -0
- package/src/scss/components/_suite-includes.scss +141 -0
- package/src/scss/components/_suite-product-card.scss +98 -0
- package/src/scss/components/_thumb-gallery-critical.scss +35 -0
- package/src/scss/components/_thumb-gallery.scss +200 -0
- package/src/scss/components/bloomreach/_why-not-add.scss +3 -1
- package/src/scss/components/checkout-payment-details-v2.scss +44 -20
- package/src/scss/components/checkout-payment-repayment-terms.scss +0 -1
- package/src/scss/components/kitchen/_price.scss +10 -0
- package/src/scss/components/kitchen/_strip-stickers.scss +46 -0
- package/src/scss/components/price-block-v2-critical.scss +62 -0
- package/src/scss/components/price-block-v2.scss +62 -0
- package/src/scss/pages/_checkout_delivery-details.scss +16 -104
- package/src/scss/pages/page_checkout_delivery-new.scss +252 -164
- package/src/scss/pages/page_product-details-v2-critical.scss +216 -109
- package/src/scss/pages/page_product-details-v2.scss +168 -107
- package/src/scss/pages/page_product-details.scss +11 -0
- package/src/scss/pages/page_products-list-combined.scss +8 -6
- package/src/scss/pages/page_products-list_v2.scss +8 -6
- package/src/scss/pdp-main-critical.scss +1 -0
- package/src/scss/pdp-main.scss +6 -0
- package/src/scss/plp-main.scss +5 -0
- package/src/sitemap.html +29 -6
- package/build/css/components/kitchen/strip-stickers.css +0 -1
- package/build/css/components/strip-stickers.css +0 -1
- package/src/scss/components/kitchen/strip-stickers.scss +0 -18
- package/src/scss/components/strip-stickers.scss +0 -18
package/src/js/emulation/mock.js
CHANGED
|
@@ -479,24 +479,24 @@ Wick.FEMock = {
|
|
|
479
479
|
|
|
480
480
|
displayPrice: {
|
|
481
481
|
currencyIso: 'GBP',
|
|
482
|
-
value:
|
|
482
|
+
value: 1605,
|
|
483
483
|
priceType: 'BUY',
|
|
484
|
-
formattedValue: '£
|
|
485
|
-
formattedPriceWithoutCurrencySymbol: '
|
|
484
|
+
formattedValue: '£1,605.00',
|
|
485
|
+
formattedPriceWithoutCurrencySymbol: '1605.00',
|
|
486
486
|
currencySymbol: '£',
|
|
487
487
|
vatRatePercentage: 20,
|
|
488
|
-
valueInPence:
|
|
489
|
-
wasPrice:
|
|
488
|
+
valueInPence: 160500,
|
|
489
|
+
wasPrice: 1899,
|
|
490
490
|
},
|
|
491
491
|
displayPriceExclusiveVat: {
|
|
492
492
|
currencyIso: 'GBP',
|
|
493
|
-
value:
|
|
493
|
+
value: 1337.5,
|
|
494
494
|
priceType: 'BUY',
|
|
495
|
-
formattedValue: '£
|
|
496
|
-
formattedPriceWithoutCurrencySymbol: '
|
|
495
|
+
formattedValue: '£1,337.50',
|
|
496
|
+
formattedPriceWithoutCurrencySymbol: '1337.50',
|
|
497
497
|
currencySymbol: '£',
|
|
498
|
-
valueInPence:
|
|
499
|
-
wasPrice:
|
|
498
|
+
valueInPence: 133750,
|
|
499
|
+
wasPrice: 1582.5,
|
|
500
500
|
},
|
|
501
501
|
},
|
|
502
502
|
},
|
|
@@ -530,22 +530,22 @@ Wick.FEMock = {
|
|
|
530
530
|
externalReviewCount: 48,
|
|
531
531
|
displayPrice: {
|
|
532
532
|
currencyIso: 'GBP',
|
|
533
|
-
value:
|
|
533
|
+
value: 7.5,
|
|
534
534
|
priceType: 'BUY',
|
|
535
|
-
formattedValue: '£7.
|
|
535
|
+
formattedValue: '£7.50',
|
|
536
536
|
formattedPriceWithoutCurrencySymbol: '7.50',
|
|
537
537
|
currencySymbol: '£',
|
|
538
538
|
vatRatePercentage: 20,
|
|
539
|
-
valueInPence:
|
|
539
|
+
valueInPence: 750,
|
|
540
540
|
},
|
|
541
541
|
displayPriceExclusiveVat: {
|
|
542
542
|
currencyIso: 'GBP',
|
|
543
|
-
value:
|
|
543
|
+
value: 6.25,
|
|
544
544
|
priceType: 'BUY',
|
|
545
545
|
formattedValue: '£6.25',
|
|
546
546
|
formattedPriceWithoutCurrencySymbol: '6.25',
|
|
547
547
|
currencySymbol: '£',
|
|
548
|
-
valueInPence:
|
|
548
|
+
valueInPence: 625,
|
|
549
549
|
},
|
|
550
550
|
},
|
|
551
551
|
},
|
|
@@ -767,16 +767,16 @@ Wick.FEMock = {
|
|
|
767
767
|
price: {
|
|
768
768
|
currencyIso: 'GBP',
|
|
769
769
|
currencySymbol: '£',
|
|
770
|
-
formattedPriceWithoutCurrencySymbol: '
|
|
771
|
-
formattedValue: '£
|
|
770
|
+
formattedPriceWithoutCurrencySymbol: '18.50',
|
|
771
|
+
formattedValue: '£18.50',
|
|
772
772
|
infoUom: 'L',
|
|
773
773
|
infoUomDescription: 'L',
|
|
774
774
|
infoUomPrice: 6.4,
|
|
775
775
|
priceType: 'BUY',
|
|
776
|
-
value:
|
|
777
|
-
valueInPence:
|
|
776
|
+
value: 18.5,
|
|
777
|
+
valueInPence: 1850,
|
|
778
778
|
vatRatePercentage: 20,
|
|
779
|
-
wasPrice: 24,
|
|
779
|
+
wasPrice: 24.5,
|
|
780
780
|
},
|
|
781
781
|
images: [
|
|
782
782
|
{
|
|
@@ -1034,16 +1034,16 @@ Wick.FEMock = {
|
|
|
1034
1034
|
},
|
|
1035
1035
|
priceExclusiveVat: {
|
|
1036
1036
|
currencyIso: 'GBP',
|
|
1037
|
-
value: 15,
|
|
1037
|
+
value: 15.42,
|
|
1038
1038
|
priceType: 'BUY',
|
|
1039
|
-
formattedValue: '£15',
|
|
1040
|
-
formattedPriceWithoutCurrencySymbol: '15',
|
|
1039
|
+
formattedValue: '£15.42',
|
|
1040
|
+
formattedPriceWithoutCurrencySymbol: '15.42',
|
|
1041
1041
|
currencySymbol: '£',
|
|
1042
1042
|
infoUom: 'length',
|
|
1043
1043
|
infoUomDescription: 'length',
|
|
1044
1044
|
infoUomPrice: 8.33,
|
|
1045
|
-
valueInPence:
|
|
1046
|
-
wasPrice: 20,
|
|
1045
|
+
valueInPence: 1542,
|
|
1046
|
+
wasPrice: 20.42,
|
|
1047
1047
|
},
|
|
1048
1048
|
downStreamData: {
|
|
1049
1049
|
fulfillmentType: 'STANDARD',
|
|
@@ -1103,29 +1103,30 @@ Wick.FEMock = {
|
|
|
1103
1103
|
isAddedToFavourites: false,
|
|
1104
1104
|
displayPrice: {
|
|
1105
1105
|
currencyIso: 'GBP',
|
|
1106
|
-
value: 18,
|
|
1106
|
+
value: 18.5,
|
|
1107
1107
|
priceType: 'BUY',
|
|
1108
|
-
formattedValue: '£18',
|
|
1109
|
-
formattedPriceWithoutCurrencySymbol: '18',
|
|
1108
|
+
formattedValue: '£18.50',
|
|
1109
|
+
formattedPriceWithoutCurrencySymbol: '18.50',
|
|
1110
1110
|
currencySymbol: '£',
|
|
1111
1111
|
infoUom: 'length',
|
|
1112
1112
|
infoUomDescription: 'length',
|
|
1113
1113
|
infoUomPrice: 10,
|
|
1114
1114
|
vatRatePercentage: 20,
|
|
1115
|
-
valueInPence:
|
|
1116
|
-
wasPrice: 24,
|
|
1115
|
+
valueInPence: 1850,
|
|
1116
|
+
wasPrice: 24.5,
|
|
1117
1117
|
},
|
|
1118
1118
|
displayPriceExclusiveVat: {
|
|
1119
1119
|
currencyIso: 'GBP',
|
|
1120
|
-
value: 15,
|
|
1120
|
+
value: 15.42,
|
|
1121
1121
|
priceType: 'BUY',
|
|
1122
|
-
formattedValue: '£15',
|
|
1123
|
-
formattedPriceWithoutCurrencySymbol: '15',
|
|
1122
|
+
formattedValue: '£15.42',
|
|
1123
|
+
formattedPriceWithoutCurrencySymbol: '15.42',
|
|
1124
1124
|
currencySymbol: '£',
|
|
1125
1125
|
infoUom: 'length',
|
|
1126
1126
|
infoUomDescription: 'length',
|
|
1127
1127
|
infoUomPrice: 8.33,
|
|
1128
|
-
valueInPence:
|
|
1128
|
+
valueInPence: 1542,
|
|
1129
|
+
wasPrice: 20.42,
|
|
1129
1130
|
},
|
|
1130
1131
|
displayPromoDescription: '5.51 GBP discount for cart for 250064, 191018',
|
|
1131
1132
|
displayPromoDescriptionExclusiveVat:
|
|
@@ -4035,3 +4036,34 @@ Wick.FEMock = {
|
|
|
4035
4036
|
</div>
|
|
4036
4037
|
`,
|
|
4037
4038
|
};
|
|
4039
|
+
|
|
4040
|
+
Wick.FEMock.dataBloomreach.similarProductsRecommendations = {
|
|
4041
|
+
...Wick.FEMock.dataBloomreach.whyNotAddRecommendations,
|
|
4042
|
+
recommendedProducts: Wick.FEMock.dataBloomreach.whyNotAddRecommendations.recommendedProducts.map(
|
|
4043
|
+
function (recommendation, index) {
|
|
4044
|
+
if (index !== 1) {
|
|
4045
|
+
return recommendation;
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
return {
|
|
4049
|
+
...recommendation,
|
|
4050
|
+
baseProduct: {
|
|
4051
|
+
...recommendation.baseProduct,
|
|
4052
|
+
displayPrice: {
|
|
4053
|
+
...recommendation.baseProduct.displayPrice,
|
|
4054
|
+
wasPrice: 9.99,
|
|
4055
|
+
},
|
|
4056
|
+
displayPriceExclusiveVat: {
|
|
4057
|
+
...recommendation.baseProduct.displayPriceExclusiveVat,
|
|
4058
|
+
wasPrice: 8.33,
|
|
4059
|
+
},
|
|
4060
|
+
},
|
|
4061
|
+
};
|
|
4062
|
+
}
|
|
4063
|
+
),
|
|
4064
|
+
widgetMetadata: {
|
|
4065
|
+
responseId: 'mock-similar-products-response',
|
|
4066
|
+
id: 'similar-products-12345',
|
|
4067
|
+
type: 'similar_products',
|
|
4068
|
+
},
|
|
4069
|
+
};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
function getHtmlByCurrentPage({ currentPage }) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
function getHtmlByCurrentPage({ currentPage, isRippleData }) {
|
|
2
|
+
let pagesData;
|
|
3
|
+
|
|
4
|
+
if (isRippleData) {
|
|
5
|
+
pagesData = Wick.VatToggle.isToggleVatAvailable()
|
|
6
|
+
? Wick.FEMock.productListVatRippleData
|
|
7
|
+
: Wick.FEMock.productListRippleData;
|
|
8
|
+
} else {
|
|
9
|
+
pagesData = Wick.VatToggle.isToggleVatAvailable()
|
|
10
|
+
? Wick.FEMock.productListVatPagesData
|
|
11
|
+
: Wick.FEMock.productListPagesData;
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
const matchingData = pagesData.find((item) => item.page === currentPage);
|
|
6
15
|
|
|
7
16
|
return matchingData.html;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function bindPostcodeCheckAvailabilityEvent() {
|
|
2
|
+
$(window).on('postcodeCheckAviability', function ({ detail: { payload, resolve } }) {
|
|
3
|
+
setTimeout(function () {
|
|
4
|
+
resolve({ postcode: payload.postcode, isAvailable: true });
|
|
5
|
+
}, 600);
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
$(document).ready(function () {
|
|
10
|
+
bindPostcodeCheckAvailabilityEvent();
|
|
11
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
$(document).ready(function () {
|
|
4
|
+
window.setTimeout(function () {
|
|
5
|
+
const $container = $('[data-similar-products-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
|
+
}
|
|
19
|
+
|
|
20
|
+
Wick.BloomreachWidget.init('similarProducts', payloadData);
|
|
21
|
+
}, 3000);
|
|
22
|
+
});
|
|
@@ -34,6 +34,7 @@ export function createBloomreachRecommendationCarouselWidget(config) {
|
|
|
34
34
|
};
|
|
35
35
|
const el = {
|
|
36
36
|
...DEFAULT_EL,
|
|
37
|
+
...(config.el || {}),
|
|
37
38
|
widgetContainer: config.widgetContainer,
|
|
38
39
|
};
|
|
39
40
|
const addToCartEvent = config.addToCartEvent || 'addToCart';
|
|
@@ -58,9 +59,6 @@ export function createBloomreachRecommendationCarouselWidget(config) {
|
|
|
58
59
|
.map(function (item) {
|
|
59
60
|
return item.baseProduct || item;
|
|
60
61
|
})
|
|
61
|
-
.filter(function (product) {
|
|
62
|
-
return config.isEligibleProduct ? config.isEligibleProduct(product) : true;
|
|
63
|
-
})
|
|
64
62
|
.slice(0, 5);
|
|
65
63
|
}
|
|
66
64
|
|
|
@@ -85,6 +83,8 @@ export function createBloomreachRecommendationCarouselWidget(config) {
|
|
|
85
83
|
...Wick.BloomreachWidget.getProductRenderData(product),
|
|
86
84
|
addToCartError: config.addToCartError,
|
|
87
85
|
showBadge: !config.hideBadge,
|
|
86
|
+
sameTab: Boolean(config.sameTab),
|
|
87
|
+
linkImage: Boolean(config.linkImage),
|
|
88
88
|
};
|
|
89
89
|
}),
|
|
90
90
|
isSingleProduct: products.length === 1,
|
|
@@ -130,7 +130,7 @@ export function createBloomreachRecommendationCarouselWidget(config) {
|
|
|
130
130
|
navigation: {
|
|
131
131
|
nextEl: $widget.find(el.next)[0],
|
|
132
132
|
prevEl: $widget.find(el.prev)[0],
|
|
133
|
-
disabledClass: 'why-not-add__arrow--disabled',
|
|
133
|
+
disabledClass: config.arrowDisabledClass || 'why-not-add__arrow--disabled',
|
|
134
134
|
},
|
|
135
135
|
pagination: {
|
|
136
136
|
el: $widget.find(el.pagination)[0],
|
|
@@ -140,8 +140,9 @@ export function createBloomreachRecommendationCarouselWidget(config) {
|
|
|
140
140
|
index + 1
|
|
141
141
|
}"></button>`;
|
|
142
142
|
},
|
|
143
|
-
bulletClass: 'why-not-add__pagination-item',
|
|
144
|
-
bulletActiveClass:
|
|
143
|
+
bulletClass: config.paginationItemClass || 'why-not-add__pagination-item',
|
|
144
|
+
bulletActiveClass:
|
|
145
|
+
config.paginationActiveItemClass || 'why-not-add__pagination-item--active',
|
|
145
146
|
},
|
|
146
147
|
});
|
|
147
148
|
|
|
@@ -56,6 +56,8 @@ export function createBloomreachWidget(config) {
|
|
|
56
56
|
config.renderWidget($container, payloadData, widget);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
Wick.BloomreachWidget.removeBlankTargets($container);
|
|
60
|
+
|
|
59
61
|
if (config.initRenderedWidget) {
|
|
60
62
|
config.initRenderedWidget($container, widget);
|
|
61
63
|
}
|
|
@@ -224,22 +226,9 @@ Wick.BloomreachWidget = {
|
|
|
224
226
|
},
|
|
225
227
|
|
|
226
228
|
getWasPriceFormatted(product) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (wasPrice && wasPrice.formattedValue) {
|
|
231
|
-
return wasPrice.formattedValue;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
if (typeof wasPrice === 'number') {
|
|
235
|
-
return Wick.BloomreachWidget.formatPrice(wasPrice);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
if (wasPrice) {
|
|
239
|
-
return `${displayPrice.currencySymbol || '£'}${wasPrice}`;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return '';
|
|
229
|
+
return Wick.BloomreachWidget.formatPromotionalPrice(
|
|
230
|
+
Wick.BloomreachWidget.getWasPrice(product)
|
|
231
|
+
);
|
|
243
232
|
},
|
|
244
233
|
|
|
245
234
|
getExcVatWasPrice(product) {
|
|
@@ -249,15 +238,7 @@ Wick.BloomreachWidget = {
|
|
|
249
238
|
(displayPriceExclusiveVat && displayPriceExclusiveVat.wasPrice) ||
|
|
250
239
|
(priceExclusiveVat && priceExclusiveVat.wasPrice);
|
|
251
240
|
|
|
252
|
-
|
|
253
|
-
return wasPrice.formattedValue;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (typeof wasPrice === 'number') {
|
|
257
|
-
return Wick.BloomreachWidget.formatPrice(wasPrice);
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return wasPrice || '';
|
|
241
|
+
return Wick.BloomreachWidget.formatPromotionalPrice(wasPrice);
|
|
261
242
|
},
|
|
262
243
|
|
|
263
244
|
getProductImage(product, fallbackProduct) {
|
|
@@ -282,9 +263,15 @@ Wick.BloomreachWidget = {
|
|
|
282
263
|
const displayPriceExcVat = Wick.BloomreachWidget.getDisplayPriceExcVat(product);
|
|
283
264
|
const wasPriceFormatted = Wick.BloomreachWidget.getWasPriceFormatted(product);
|
|
284
265
|
const isSwitchVat = !!(window.ACC && window.ACC.app && window.ACC.app.isVatToggleAvailable);
|
|
285
|
-
const
|
|
266
|
+
const incVatFormattedValue = wasPriceFormatted
|
|
267
|
+
? Wick.BloomreachWidget.formatPromotionalPrice(displayPrice)
|
|
268
|
+
: Wick.BloomreachWidget.getPriceFormattedValue(displayPrice);
|
|
269
|
+
const excVatValue = options.fallbackExcVat
|
|
286
270
|
? Wick.BloomreachWidget.getExcVatFormattedValue(product, displayPrice)
|
|
287
271
|
: Wick.BloomreachWidget.getPriceFormattedValue(displayPriceExcVat);
|
|
272
|
+
const excVatFormattedValue = wasPriceFormatted
|
|
273
|
+
? Wick.BloomreachWidget.formatPromotionalPrice(displayPriceExcVat || excVatValue)
|
|
274
|
+
: excVatValue;
|
|
288
275
|
|
|
289
276
|
return {
|
|
290
277
|
...product,
|
|
@@ -295,7 +282,7 @@ Wick.BloomreachWidget = {
|
|
|
295
282
|
Wick.BloomreachWidget.getProductImage(product, options.fallbackProduct),
|
|
296
283
|
wasPriceFormatted,
|
|
297
284
|
'switch-vat': isSwitchVat,
|
|
298
|
-
incVatFormattedValue
|
|
285
|
+
incVatFormattedValue,
|
|
299
286
|
incVatValue: Wick.BloomreachWidget.getPriceValue(displayPrice),
|
|
300
287
|
excVatFormattedValue,
|
|
301
288
|
excVatValue: Wick.BloomreachWidget.getPriceValue(displayPriceExcVat),
|
|
@@ -359,6 +346,39 @@ Wick.BloomreachWidget = {
|
|
|
359
346
|
$(window).off(eventName).on(eventName, Wick.BloomreachWidget.reapplyVatDisplay);
|
|
360
347
|
},
|
|
361
348
|
|
|
349
|
+
formatPromotionalPrice(price) {
|
|
350
|
+
if (price === null || price === undefined) {
|
|
351
|
+
return '';
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const rawValue =
|
|
355
|
+
typeof price === 'object'
|
|
356
|
+
? typeof price.value === 'number'
|
|
357
|
+
? price.value
|
|
358
|
+
: price.formattedValue
|
|
359
|
+
: price;
|
|
360
|
+
|
|
361
|
+
if (rawValue === null || rawValue === undefined || rawValue === '') {
|
|
362
|
+
return '';
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
const value =
|
|
366
|
+
typeof rawValue === 'number'
|
|
367
|
+
? rawValue
|
|
368
|
+
: Number(`${rawValue}`.replace(/[,£\s]/g, ''));
|
|
369
|
+
|
|
370
|
+
if (!Number.isFinite(value)) {
|
|
371
|
+
return typeof rawValue === 'string' ? rawValue : '';
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return new Intl.NumberFormat('en-GB', {
|
|
375
|
+
style: 'currency',
|
|
376
|
+
currency: 'GBP',
|
|
377
|
+
minimumFractionDigits: Math.round(Math.abs(value) * 100) % 100 === 0 ? 0 : 2,
|
|
378
|
+
maximumFractionDigits: 2,
|
|
379
|
+
}).format(value);
|
|
380
|
+
},
|
|
381
|
+
|
|
362
382
|
formatPrice(value) {
|
|
363
383
|
return new Intl.NumberFormat('en-GB', {
|
|
364
384
|
style: 'currency',
|
|
@@ -4,6 +4,7 @@ import './bloomreach-widget-core';
|
|
|
4
4
|
import Widget from './complete-your-project/widget';
|
|
5
5
|
import WhyNotAddWidget from './why-not-add-widget';
|
|
6
6
|
import DontForgetWidget from './dont-forget-widget';
|
|
7
|
+
import SimilarProductsWidget from './similar-products-widget';
|
|
7
8
|
|
|
8
9
|
Wick.BloomreachWidget.registerWidgets([
|
|
9
10
|
{
|
|
@@ -18,4 +19,8 @@ Wick.BloomreachWidget.registerWidgets([
|
|
|
18
19
|
type: 'dontForget',
|
|
19
20
|
widget: DontForgetWidget,
|
|
20
21
|
},
|
|
22
|
+
{
|
|
23
|
+
type: 'similarProducts',
|
|
24
|
+
widget: SimilarProductsWidget,
|
|
25
|
+
},
|
|
21
26
|
]);
|
|
@@ -70,16 +70,21 @@ export function createCompleteYourProjectView(model, presenter) {
|
|
|
70
70
|
if (response.totalWasPrice) {
|
|
71
71
|
$total.addClass('complete-widget__total-sale');
|
|
72
72
|
|
|
73
|
+
const formatPrice = Wick.BloomreachWidget.formatPromotionalPrice;
|
|
74
|
+
const wasPrice = formatPrice(response.totalWasPrice);
|
|
75
|
+
const salePrice = formatPrice(response.totalPrice);
|
|
76
|
+
const excVatWasPrice = formatPrice(totalWasPriceExclusiveVat || response.totalWasPrice);
|
|
77
|
+
const excVatSalePrice = formatPrice(totalPriceExclusiveVat || response.totalPrice);
|
|
73
78
|
const $priceInc = $price.find(vatInc);
|
|
74
79
|
|
|
75
80
|
if ($priceInc.length) {
|
|
76
|
-
$priceInc.text(
|
|
77
|
-
$price.find(vatExc).text(
|
|
78
|
-
$salePrice.find(vatInc).text(
|
|
79
|
-
$salePrice.find(vatExc).text(
|
|
81
|
+
$priceInc.text(wasPrice);
|
|
82
|
+
$price.find(vatExc).text(excVatWasPrice);
|
|
83
|
+
$salePrice.find(vatInc).text(salePrice);
|
|
84
|
+
$salePrice.find(vatExc).text(excVatSalePrice);
|
|
80
85
|
} else {
|
|
81
|
-
$price.text(
|
|
82
|
-
$salePrice.text(
|
|
86
|
+
$price.text(wasPrice);
|
|
87
|
+
$salePrice.text(salePrice);
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
$salePrice.show();
|
|
@@ -124,7 +124,6 @@ function initRenderedWidget($container) {
|
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
Wick.BloomreachWidget.removeBlankTargets($completeWidget);
|
|
128
127
|
Wick.BloomreachWidget.drawRating($completeWidget);
|
|
129
128
|
cards.bindCardSelection($completeWidget);
|
|
130
129
|
cards.bindDropdowns();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createBloomreachRecommendationCarouselWidget } from './bloomreach-recommendation-carousel-widget';
|
|
2
|
+
|
|
3
|
+
const SimilarProductsWidget = createBloomreachRecommendationCarouselWidget({
|
|
4
|
+
namespace: 'similarProducts',
|
|
5
|
+
title: 'Similar products',
|
|
6
|
+
widgetContainer: '[data-similar-products-widget]',
|
|
7
|
+
disableAfterSuccess: false,
|
|
8
|
+
disableAfterFailure: false,
|
|
9
|
+
hideBadge: true,
|
|
10
|
+
sameTab: true,
|
|
11
|
+
linkImage: true,
|
|
12
|
+
el: {
|
|
13
|
+
productLink: '.why-not-add-card__title, .why-not-add-card__image-link',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export default SimilarProductsWidget;
|
|
@@ -1,77 +1,92 @@
|
|
|
1
|
-
import {createEvent} from
|
|
2
|
-
import {appendLoader, showLoader, hideLoader} from
|
|
1
|
+
import { createEvent } from './utils/create-event';
|
|
2
|
+
import { appendLoader, showLoader, hideLoader } from './utils/loader';
|
|
3
3
|
|
|
4
4
|
var Wick = window.Wick || {};
|
|
5
5
|
|
|
6
6
|
Wick.PLPLoadMore = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
PLP_LOAD_MORE_EVENT: 'loadMore',
|
|
8
|
+
HIDDEN_CLASS_NAME: 'd-none',
|
|
9
|
+
MAX_PRODUCTS_PER_PAGE: 32,
|
|
10
|
+
initialPageNumber: 0,
|
|
11
|
+
el: {
|
|
12
|
+
$loadMoreBtn: $('.btn-load-more'),
|
|
13
|
+
loader: '.loader-wrapper',
|
|
14
|
+
$sortOptions: $('#sort_form1'),
|
|
15
|
+
productsList: $('.package-plp__cards').length ? '.package-plp__cards' : '.products-list',
|
|
16
|
+
$packageContent: $('.package-plp__content'),
|
|
17
|
+
},
|
|
18
|
+
numberOfPagesPLP: $('#numberOfPagesPLP').val(),
|
|
19
|
+
loaderPayload: {
|
|
20
|
+
wrapper: 'body',
|
|
21
|
+
hidden: true,
|
|
22
|
+
modifier: 'basket-loader',
|
|
23
|
+
},
|
|
24
|
+
loadMore() {
|
|
25
|
+
showLoader(Wick.PLPLoadMore.el.loader);
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
const eventDetail = { resolve, reject };
|
|
29
|
+
const payload = {
|
|
30
|
+
currentPage: ++Wick.PLPLoadMore.initialPageNumber,
|
|
31
|
+
sort: Wick.PLPLoadMore.el.$sortOptions.val() || '',
|
|
32
|
+
isRippleData: Wick.PLPLoadMore.el.$packageContent.length,
|
|
33
|
+
};
|
|
34
|
+
const event = createEvent(Wick.PLPLoadMore.PLP_LOAD_MORE_EVENT, payload, eventDetail);
|
|
35
|
+
window.dispatchEvent(event);
|
|
36
|
+
})
|
|
37
|
+
.then((response) => {
|
|
38
|
+
if (!response.length) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Wick.PLPLoadMore.showNewCards(response);
|
|
43
|
+
Wick.PLPLoadMore.toggleLoadMoreBtn();
|
|
44
|
+
Wick.VatToggle.reapplyDisplayClass();
|
|
45
|
+
})
|
|
46
|
+
.finally(() => {
|
|
47
|
+
hideLoader(Wick.PLPLoadMore.el.loader);
|
|
48
|
+
Wick.PLPLoadMore.el.$loadMoreBtn.blur();
|
|
49
|
+
Wick.BannerPlacementManager.checkProductsInColumn();
|
|
50
|
+
$(window).trigger('productBannerPositionChanged');
|
|
51
|
+
Wick.EnergyEfficiency.drawEnergyLabels();
|
|
52
|
+
Wick.PLP?.bindEvents();
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
showNewCards(newProductsHtml) {
|
|
56
|
+
const $newProductsHtml = $(newProductsHtml);
|
|
57
|
+
$(Wick.PLPLoadMore.el.productsList).append($newProductsHtml);
|
|
58
|
+
Wick.PackageCards.alignGridRows();
|
|
59
|
+
},
|
|
60
|
+
toggleLoadMoreBtn(checkCardsAmount = false) {
|
|
61
|
+
const isLastPage =
|
|
62
|
+
Wick.PLPLoadMore.initialPageNumber + 1 >= +Wick.PLPLoadMore.numberOfPagesPLP;
|
|
63
|
+
let shouldHide = isLastPage;
|
|
64
|
+
|
|
65
|
+
if (checkCardsAmount) {
|
|
66
|
+
const cardsCount = $(Wick.PLPLoadMore.el.productsList).children().length;
|
|
67
|
+
shouldHide = cardsCount <= Wick.PLPLoadMore.MAX_PRODUCTS_PER_PAGE && isLastPage;
|
|
37
68
|
}
|
|
38
69
|
|
|
39
|
-
Wick.PLPLoadMore.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Wick.PLPLoadMore.el.$loadMoreBtn.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Wick.EnergyEfficiency.drawEnergyLabels();
|
|
49
|
-
Wick.PLP?.bindEvents();
|
|
50
|
-
})
|
|
51
|
-
},
|
|
52
|
-
showNewCards (newProductsHtml) {
|
|
53
|
-
const $newProductsHtml = $(newProductsHtml);
|
|
54
|
-
$(Wick.PLPLoadMore.el.productsList).append($newProductsHtml);
|
|
55
|
-
},
|
|
56
|
-
toggleLoadMoreBtn() {
|
|
57
|
-
if (Wick.PLPLoadMore.initialPageNumber + 1 >= +Wick.PLPLoadMore.numberOfPagesPLP) {
|
|
58
|
-
Wick.PLPLoadMore.el.$loadMoreBtn.addClass(Wick.PLPLoadMore.HIDDEN_CLASS_NAME);
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
init () {
|
|
62
|
-
if (!Wick.PLPLoadMore.el.$loadMoreBtn.length) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
appendLoader(Wick.PLPLoadMore.loaderPayload);
|
|
70
|
+
Wick.PLPLoadMore.el.$loadMoreBtn.toggleClass(
|
|
71
|
+
Wick.PLPLoadMore.HIDDEN_CLASS_NAME,
|
|
72
|
+
shouldHide
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
init() {
|
|
76
|
+
if (!Wick.PLPLoadMore.el.$loadMoreBtn.length) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
66
79
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
80
|
+
if (Wick.PLPLoadMore.el.$packageContent.length) {
|
|
81
|
+
Wick.PLPLoadMore.toggleLoadMoreBtn(true);
|
|
82
|
+
}
|
|
70
83
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
appendLoader(Wick.PLPLoadMore.loaderPayload);
|
|
85
|
+
|
|
86
|
+
Wick.PLPLoadMore.el.$loadMoreBtn.on('click', Wick.PLPLoadMore.loadMore);
|
|
87
|
+
},
|
|
88
|
+
};
|
|
75
89
|
|
|
76
|
-
|
|
90
|
+
$(document).ready(function () {
|
|
91
|
+
Wick.PLPLoadMore.init();
|
|
77
92
|
});
|