wickes-css2 2.107.0-ripple.2 → 2.107.0-ripple.21
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/build/css/category-main.css +1 -1
- package/build/css/components/card-product-banner.css +1 -1
- package/build/css/components/checkout-chip.css +1 -1
- package/build/css/components/checkout-payment-details-v2.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/components/special-opening-schedule-v2.css +1 -1
- package/build/css/components/special-opening-schedule.css +1 -1
- package/build/css/emulation.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/checkout-new.css +1 -1
- package/build/css/pages/my-account-v2.css +1 -1
- package/build/css/pages/page_checkout_delivery-new.css +1 -1
- package/build/css/pages/page_merged-basket.css +1 -1
- package/build/css/pages/page_personal-details.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.css +1 -1
- package/build/css/pages/page_shopping-cart-v2.css +1 -1
- package/build/css/pages/page_store-locator-details.css +1 -1
- package/build/css/pages/page_store-locator.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-hub.min.js +1 -1
- package/build/js/basket.min.js +2 -2
- package/build/js/bloomreach-widget.min.js +1 -0
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +2 -2
- package/build/js/components/general/accordion.js +69 -0
- package/build/js/components/general/back-to-top.js +45 -0
- package/build/js/components/general/backdrop.js +23 -0
- package/build/js/components/general/cart-slider.js +36 -0
- package/build/js/components/general/clamp-content.js +95 -0
- package/build/js/components/general/clamp.js +216 -0
- package/build/js/components/general/clear-input.js +33 -0
- package/build/js/components/general/cookie-chat-back.js +51 -0
- package/build/js/components/general/cookies-policy.js +9 -0
- package/build/js/components/general/create-popup-slider.js +194 -0
- package/build/js/components/general/device-type.js +6 -0
- package/build/js/components/general/footer.js +67 -0
- package/build/js/components/general/handleAccordion.js +35 -0
- package/build/js/components/general/image-accordion.js +54 -0
- package/build/js/components/general/is-trade-pro.js +38 -0
- package/build/js/components/general/main-nav.js +16 -0
- package/build/js/components/general/main-navigation.js +275 -0
- package/build/js/components/general/notification.js +70 -0
- package/build/js/components/general/offer-banner.js +74 -0
- package/build/js/components/general/scroll-disable.js +54 -0
- package/build/js/components/general/search.js +43 -0
- package/build/js/components/general/snack-bar.js +160 -0
- package/build/js/components/general/sticky_header.js +62 -0
- package/build/js/components/general/switchVat.js +161 -0
- package/build/js/components/general/text-clamp.js +102 -0
- package/build/js/components/general/tooltips.js +8 -0
- package/build/js/components/general/validation.js +48 -0
- package/build/js/emulation.min.js +3377 -164
- 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/mini-basket-slider.min.js +1 -1
- package/build/js/package-bulk-add.min.js +1 -0
- package/build/js/page/basket/mini-basket-total.js +17 -2
- package/build/js/page/bloomreach-widget.js +1148 -0
- package/build/js/page/checkout-payment-details.js +12 -1
- package/build/js/page/checkout.js +1 -1
- package/build/js/page/components/notify-me.js +99 -0
- package/build/js/page/components/order-summary.js +35 -0
- package/build/js/page/plp-load-more.js +81 -66
- package/build/js/page/ripple/bulk-add.js +63 -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 +168 -0
- package/build/js/page/utils/create-count-stepper.js +30 -9
- package/build/js/page/utils/create-loading-button.js +37 -0
- package/build/js/page/utils/create-toast.js +79 -0
- package/build/js/page/utils/custom-dropdown.js +80 -0
- package/build/js/pdp-count-stepper.min.js +1 -1
- package/build/js/pdp.bundle.min.js +2 -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 +1 -1
- package/build/js/saving-shopping-list.min.js +1 -1
- package/build/js/wickes-dc.js +1 -0
- package/package.json +1 -4
- package/src/badges-ripple.html +120 -0
- package/src/badges.html +9 -18
- package/src/components/base/button.hbs +23 -5
- package/src/components/bloomreach/complete-card-dropdown.hbs +47 -0
- package/src/components/bloomreach/complete-card-skeleton.hbs +19 -0
- package/src/components/bloomreach/complete-card.hbs +138 -0
- package/src/components/bloomreach/complete-divider.hbs +3 -0
- package/src/components/bloomreach/complete-summary-skeleton.hbs +12 -0
- package/src/components/bloomreach/complete-summary.hbs +43 -0
- package/src/components/bloomreach/complete-wrapper.hbs +1 -0
- package/src/components/bloomreach/complete-your-project.hbs +21 -0
- package/src/components/card-store-locator.hbs +70 -33
- package/src/components/card_bloomreach_media_banner.hbs +10 -0
- package/src/components/card_product_banner_v2.hbs +4 -1
- package/src/components/card_sponsor_banner.hbs +4 -1
- package/src/components/cart-voucher.hbs +10 -1
- package/src/components/checkout_order-summary-new.hbs +11 -2
- package/src/components/click-and-collect-modal.hbs +0 -14
- package/src/components/date-selection.hbs +1 -1
- package/src/components/delivery-types.hbs +11 -3
- package/src/components/fulfilment-accordions.hbs +1 -1
- package/src/components/gift-cards.hbs +1 -1
- package/src/components/injected-content.hbs +6 -1
- package/src/components/kitchen/price.hbs +49 -29
- package/src/components/kitchen/strip-stickers.hbs +9 -3
- package/src/components/modal.hbs +1 -1
- package/src/components/modals/notify-me-modal.hbs +76 -0
- package/src/components/order-item.hbs +18 -5
- package/src/components/order-summary.hbs +2 -2
- 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/potential-promotion.hbs +12 -3
- package/src/components/price-badges.hbs +14 -0
- package/src/components/price-block-v2.hbs +91 -31
- package/src/components/product-main-info-v2.hbs +2 -0
- package/src/components/sponsor-top-banner.hbs +10 -0
- package/src/components/suite-includes.hbs +43 -12
- package/src/components/suite-product-card.hbs +37 -15
- 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_delivery-address-v2.json +1 -1
- package/src/data/data_locators.json +441 -135
- package/src/data/data_search-results_v2.json +20 -2
- package/src/data/data_shopping-cart-v2.json +23 -5
- package/src/data/data_spr_injected_content.json +4 -0
- package/src/data/data_suite-includes-products.json +73 -2
- package/src/elements/checkbox.hbs +8 -1
- package/src/js/components/banner-placement-manager.js +25 -9
- package/src/js/components/general/accordion.js +25 -2
- package/src/js/components/general/cart-slider.js +19 -6
- 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 +285 -53
- package/src/js/emulation/bloomreach-widget-calculations.js +132 -0
- package/src/js/emulation/bloomreach-widget-loading.js +11 -0
- package/src/js/emulation/checkout-delivery-details.js +28 -25
- package/src/js/emulation/custom-slider-emulation.js +1 -1
- package/src/js/emulation/date-selection.js +136 -24
- package/src/js/emulation/forms.js +12 -0
- package/src/js/emulation/gift-cards.js +1 -1
- package/src/js/emulation/mini-basket-data.js +3 -3
- package/src/js/emulation/mock.js +3112 -4
- package/src/js/emulation/notify-me.js +9 -0
- package/src/js/emulation/plp-load-more.js +13 -4
- package/src/js/emulation/postcode-checker.js +11 -0
- package/src/js/emulation/store-locator-load-more.js +69 -0
- package/src/js/emulation/switchCalendar.js +12 -8
- package/src/js/page/basket/mini-basket-total.js +17 -2
- package/src/js/page/bloomreach-widget.js +1148 -0
- package/src/js/page/checkout-payment-details.js +12 -1
- package/src/js/page/checkout.js +1 -1
- package/src/js/page/components/notify-me.js +99 -0
- package/src/js/page/components/order-summary.js +35 -0
- package/src/js/page/plp-load-more.js +81 -66
- package/src/js/page/ripple/bulk-add.js +63 -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 +168 -0
- package/src/js/page/utils/create-count-stepper.js +30 -9
- package/src/js/page/utils/create-loading-button.js +37 -0
- package/src/js/page/utils/create-toast.js +79 -0
- package/src/js/page/utils/custom-dropdown.js +80 -0
- 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_next-day-delivery-details.html +2 -2
- package/src/page_checkout_payment-details-v2-asm.html +1 -1
- package/src/page_checkout_payment-details-v2.html +1 -1
- package/src/page_checkout_payment-details_with-card-loader.html +1 -1
- package/src/page_checkout_payment-details_with-klarna-loader.html +1 -1
- package/src/page_checkout_payment-details_with-loader-v2.html +1 -1
- package/src/page_checkout_rapid-delivery-details.html +7 -5
- package/src/page_klarna_payment-details_with-klarna.html +1 -1
- package/src/page_my-account-installer-carousel.html +131 -0
- package/src/page_payment-details-with-billie.html +1 -1
- package/src/page_payment-details-with-clearpay.html +1 -1
- package/src/page_payment-details-with-gift-card.html +1 -1
- package/src/page_payment-details_with_apple-pay.html +1 -1
- package/src/page_payment-details_with_google-pay.html +1 -1
- package/src/page_plp_bloomreach.html +81 -0
- package/src/page_plp_v2.html +6 -0
- package/src/page_product-details-banner.html +1 -4
- package/src/page_product-details-big-wins-disabled-delivery.html +1 -4
- package/src/page_product-details-big-wins-non-registered.html +1 -4
- package/src/page_product-details-big-wins-out-nearest.html +1 -4
- package/src/page_product-details-big-wins-unhappy.html +1 -4
- package/src/page_product-details-big-wins.html +1 -4
- package/src/page_product-details-billie.html +1 -4
- package/src/page_product-details-bloomreach.html +130 -0
- package/src/page_product-details-calculator.html +1 -4
- package/src/page_product-details-cashback-v2.html +1 -4
- package/src/page_product-details-clearpay.html +1 -4
- package/src/page_product-details-cnc-error-notification.html +1 -4
- package/src/page_product-details-cnc-success-notification-vat.html +1 -5
- package/src/page_product-details-cnc-success-notification.html +1 -4
- package/src/page_product-details-default-store.html +1 -4
- package/src/page_product-details-energy-efficiency.html +1 -4
- package/src/page_product-details-flooring-with-pr-placeholder.html +1 -4
- package/src/page_product-details-flooring.html +1 -4
- package/src/page_product-details-gallery-actual.html +1 -4
- package/src/page_product-details-mfe-calculator.html +10 -7
- package/src/page_product-details-minimum-v2.html +0 -1
- package/src/page_product-details-mtm-doors.html +1 -4
- package/src/page_product-details-only-clearpay.html +1 -4
- package/src/page_product-details-paint-mixing.html +1 -4
- package/src/page_product-details-ripple-gallery.html +119 -0
- package/src/page_product-details-saved-pl.html +1 -4
- package/src/page_product-details-suite-includes-banners.html +139 -0
- package/src/page_product-details-suite-includes-vat.html +126 -0
- package/src/page_product-details-suite-includes.html +32 -20
- package/src/page_product-details-tile-steps-klarna-widget-with-method-ids.html +1 -4
- package/src/page_product-details-tile-steps-logout.html +1 -4
- package/src/page_product-details-tile-steps-no-new-project-list.html +1 -4
- package/src/page_product-details-tile-steps-with-klarna.html +1 -4
- package/src/page_product-details-tile-steps.html +1 -4
- package/src/page_product-details-v2.html +1 -4
- package/src/page_product-details-vat.html +1 -4
- package/src/page_product-details-wisdom-mcfc-registered.html +1 -4
- package/src/page_product-details-wisdom-mcfc.html +1 -4
- package/src/page_product-details-wisdom-oos-registered.html +1 -4
- package/src/page_product-details-wisdom-oos.html +1 -4
- package/src/page_product-details-wisdom-registered.html +1 -4
- package/src/page_product-details-wisdom.html +1 -4
- package/src/page_product-details-with-favourite.html +1 -4
- package/src/page_product-details-with-global-search-v2.html +8 -4
- package/src/page_product-details_no-previous-default.html +1 -4
- package/src/page_shopping-cart-v2-vat.html +2 -1
- package/src/page_store-locator-list.html +17 -28
- package/src/page_track-my-order-result.html +1 -0
- package/src/partials/scripts.hbs +1 -0
- package/src/scss/common/_CTAs.scss +7 -3
- package/src/scss/common/_common.scss +1 -0
- package/src/scss/common/_elements.scss +13 -1
- package/src/scss/common/_loading-button.scss +49 -0
- package/src/scss/components/_card-store-locator.scss +139 -32
- package/src/scss/components/_custom-slider.scss +18 -0
- package/src/scss/components/_date-selection-add-new-styles.scss +43 -1
- package/src/scss/components/_image-accordion.scss +5 -2
- package/src/scss/components/_kitchen-card.scss +5 -4
- package/src/scss/components/_notifications.scss +86 -5
- package/src/scss/components/_notify-me-modal.scss +139 -0
- package/src/scss/components/_order-summary.scss +25 -12
- package/src/scss/components/_package-card.scss +63 -0
- package/src/scss/components/_package-plp.scss +88 -0
- package/src/scss/components/_pdp-action-v2-critical.scss +12 -0
- package/src/scss/components/_pdp-action-v2.scss +12 -0
- package/src/scss/components/_postcode-checker.scss +115 -0
- package/src/scss/components/_price-badges-critical.scss +10 -1
- package/src/scss/components/_price-badges.scss +10 -2
- package/src/scss/components/_price-block-critical.scss +11 -3
- package/src/scss/components/_price-block.scss +15 -4
- package/src/scss/components/_suite-includes.scss +29 -26
- package/src/scss/components/_suite-product-card.scss +33 -23
- package/src/scss/components/_thumb-gallery-critical.scss +34 -0
- package/src/scss/components/_thumb-gallery.scss +192 -0
- package/src/scss/components/bloomreach/_bloomreach.scss +3 -0
- package/src/scss/components/bloomreach/_complete-card-dropdown.scss +174 -0
- package/src/scss/components/bloomreach/_complete-card.scss +402 -0
- package/src/scss/components/bloomreach/_complete-your-project.scss +207 -0
- package/src/scss/components/card-product-banner.scss +35 -27
- package/src/scss/components/checkout-chip.scss +1 -0
- package/src/scss/components/checkout-payment-details-v2.scss +12 -0
- package/src/scss/components/kitchen/_price.scss +10 -0
- package/src/scss/components/kitchen/_strip-stickers.scss +46 -0
- package/src/scss/components/my-account/_clipboard-code.scss +4 -0
- package/src/scss/components/price-block-v2-critical.scss +54 -1
- package/src/scss/components/price-block-v2.scss +54 -3
- package/src/scss/components/special-opening-schedule-v2.scss +2 -6
- package/src/scss/components/special-opening-schedule.scss +17 -4
- package/src/scss/emulation.scss +0 -6
- package/src/scss/helpers/_CTAs.scss +15 -5
- package/src/scss/helpers/_variables.scss +1 -0
- package/src/scss/pages/page_checkout_delivery-new.scss +36 -0
- package/src/scss/pages/page_product-details-v2-critical.scss +217 -111
- package/src/scss/pages/page_product-details-v2.scss +200 -109
- package/src/scss/pages/page_product-details.scss +0 -2
- package/src/scss/pages/page_products-list-combined.scss +8 -1
- package/src/scss/pages/page_products-list.scss +8 -1
- package/src/scss/pages/page_shopping-cart-v2.scss +34 -10
- package/src/scss/pages/page_store-locator.scss +48 -26
- package/src/scss/pdp-main-critical.scss +1 -1
- package/src/scss/pdp-main.scss +5 -1
- package/src/scss/plp-main.scss +5 -0
- package/src/scss/store-locator-main.scss +15 -1
- package/src/sitemap.html +15 -0
- package/build/css/components/kitchen/strip-stickers.css +0 -1
- package/build/css/components/strip-stickers.css +0 -1
- package/src/js/emulation/store-locator-list.js +0 -19
- package/src/scss/components/kitchen/strip-stickers.scss +0 -18
- package/src/scss/components/strip-stickers.scss +0 -18
|
@@ -1,53 +1,285 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
(function () {
|
|
2
|
+
// Simulate prompt for input
|
|
3
|
+
|
|
4
|
+
function parseSlots(value) {
|
|
5
|
+
if (!value) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return String(value)
|
|
10
|
+
.split(',')
|
|
11
|
+
.map((item) => parseInt(item.trim(), 10))
|
|
12
|
+
.filter((item) => Number.isInteger(item) && item >= 0);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function isBloomreachDisabled(slots) {
|
|
16
|
+
return !slots.length || slots.every((s) => s === 0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleHybrisProductBanners(inputs) {
|
|
20
|
+
const banners = document.querySelectorAll('.card-product-banner');
|
|
21
|
+
const disabled = isBloomreachDisabled(inputs.bloomreachSlots);
|
|
22
|
+
|
|
23
|
+
banners.forEach((banner) => {
|
|
24
|
+
if (disabled) {
|
|
25
|
+
banner.classList.remove('d-none');
|
|
26
|
+
banner.classList.remove('card-product-banner--inactive');
|
|
27
|
+
} else {
|
|
28
|
+
banner.classList.add('d-none');
|
|
29
|
+
banner.classList.add('card-product-banner--inactive');
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getPositionAttr() {
|
|
35
|
+
const isMobile = window.Wick?.BannerPlacementManager?.isMobileResolution();
|
|
36
|
+
|
|
37
|
+
return isMobile ? 'data-mobile-position' : 'data-desktop-position';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function setUnifiedPosition(el, slot) {
|
|
41
|
+
el.setAttribute('data-desktop-position', String(slot));
|
|
42
|
+
el.setAttribute('data-mobile-position', String(slot));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function hasLegacyBanners() {
|
|
46
|
+
return Boolean(
|
|
47
|
+
document.querySelector('.card-product-banner') ||
|
|
48
|
+
document.querySelector('.card-sponsor-product') ||
|
|
49
|
+
document.querySelector('.card-sponsor-banner')
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isPackagePlp() {
|
|
54
|
+
const manager = window.Wick?.BannerPlacementManager;
|
|
55
|
+
const productsWrapSelector = manager
|
|
56
|
+
? manager.el.productsWrap
|
|
57
|
+
: '.products-list.products-list-v2';
|
|
58
|
+
return (
|
|
59
|
+
productsWrapSelector.includes('.package-plp__cards') ||
|
|
60
|
+
document.querySelector('.package-plp__cards') !== null
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function getInputs() {
|
|
65
|
+
const hasLegacy = hasLegacyBanners();
|
|
66
|
+
|
|
67
|
+
const bloomreachSlots = parseSlots(
|
|
68
|
+
prompt('Enter Bloomreach Banner Slots (comma-separated):', '3') || ''
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
if (!hasLegacy) {
|
|
72
|
+
return {
|
|
73
|
+
bloomreachSlots,
|
|
74
|
+
sponsorProductPositions: [],
|
|
75
|
+
sponsorBannerPositions: [],
|
|
76
|
+
productBannerPositions: [],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const productBannerPositions =
|
|
81
|
+
prompt('Enter Product Banner Positions (comma-separated):', '2') || '';
|
|
82
|
+
|
|
83
|
+
const sponsorProductPositions = isPackagePlp()
|
|
84
|
+
? ''
|
|
85
|
+
: prompt('Enter Sponsor Product Positions (comma-separated):', '6,7,8') || '';
|
|
86
|
+
|
|
87
|
+
const sponsorBannerPositions =
|
|
88
|
+
prompt('Enter Sponsor Banner Positions (comma-separated):', '10') || '';
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
productBannerPositions: parseSlots(productBannerPositions),
|
|
92
|
+
sponsorProductPositions: parseSlots(sponsorProductPositions),
|
|
93
|
+
sponsorBannerPositions: parseSlots(sponsorBannerPositions),
|
|
94
|
+
bloomreachSlots,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function updateBannerPositions(selector, positions) {
|
|
99
|
+
if (!positions?.length) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const positionAttr = getPositionAttr();
|
|
104
|
+
const elements = document.querySelectorAll(selector);
|
|
105
|
+
|
|
106
|
+
elements.forEach((el, index) => {
|
|
107
|
+
if (positions[index] !== undefined) {
|
|
108
|
+
el.setAttribute(positionAttr, String(positions[index]));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function updatePositions(inputs) {
|
|
114
|
+
updateBannerPositions('.card-product-banner', inputs.productBannerPositions);
|
|
115
|
+
updateBannerPositions('.card-sponsor-product', inputs.sponsorProductPositions);
|
|
116
|
+
updateBannerPositions('.card-sponsor-banner', inputs.sponsorBannerPositions);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function patchBannerPlacementManagerForBloomreachEmulation(inputs) {
|
|
120
|
+
const manager = window.Wick?.BannerPlacementManager;
|
|
121
|
+
|
|
122
|
+
if (!manager || manager.__bloomreachEmulationPatched) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const shouldDisableProductBanners = Boolean(inputs.bloomreachSlots?.length);
|
|
127
|
+
const includeSponsorProduct = !isPackagePlp();
|
|
128
|
+
|
|
129
|
+
manager.el.bloomreachBanners = '.card-bloomreach-media-banner';
|
|
130
|
+
|
|
131
|
+
let activeBanners = ['.card-bloomreach-media-banner', '.card-sponsor-banner'];
|
|
132
|
+
if (!shouldDisableProductBanners) activeBanners.push('.card-product-banner');
|
|
133
|
+
if (includeSponsorProduct) activeBanners.push('.card-sponsor-product');
|
|
134
|
+
|
|
135
|
+
manager.el.allBanners = activeBanners.join(', ');
|
|
136
|
+
|
|
137
|
+
let activeListSlots = [
|
|
138
|
+
manager.el.productCard || '.product-card',
|
|
139
|
+
'.card-bloomreach-media-banner',
|
|
140
|
+
'.card-sponsor-banner',
|
|
141
|
+
];
|
|
142
|
+
if (!shouldDisableProductBanners) activeListSlots.push('.card-product-banner');
|
|
143
|
+
if (includeSponsorProduct) activeListSlots.push('.card-sponsor-product');
|
|
144
|
+
|
|
145
|
+
manager.el.allListSlots = activeListSlots.join(', ');
|
|
146
|
+
manager.classes.bloomreachBanners = 'card-bloomreach-media-banner';
|
|
147
|
+
|
|
148
|
+
manager.getListSlots = function () {
|
|
149
|
+
return $(manager.el.productsWrap)
|
|
150
|
+
.children(manager.el.allListSlots)
|
|
151
|
+
.filter(function () {
|
|
152
|
+
if (
|
|
153
|
+
$(this).hasClass(manager.classes.productBanners) ||
|
|
154
|
+
$(this).hasClass(manager.classes.bloomreachBanners)
|
|
155
|
+
) {
|
|
156
|
+
const position = manager.getBannerPosition(this);
|
|
157
|
+
const productsCount = manager.getListLength();
|
|
158
|
+
|
|
159
|
+
return position <= productsCount;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return true;
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
manager.arrangeBannersInRightOrder = function () {
|
|
167
|
+
const $allBanners = $(manager.el.allBanners);
|
|
168
|
+
|
|
169
|
+
function getSameSlotInsertionOrder(el) {
|
|
170
|
+
if ($(el).hasClass(manager.classes.bloomreachBanners)) {
|
|
171
|
+
return 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if ($(el).hasClass(manager.classes.sponsorBanners)) {
|
|
175
|
+
return 1;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if ($(el).hasClass(manager.classes.sponsorProducts)) {
|
|
179
|
+
return 2;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if ($(el).hasClass(manager.classes.productBanners)) {
|
|
183
|
+
return 3;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return 4;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
$allBanners
|
|
190
|
+
.sort((a, b) => {
|
|
191
|
+
const positionA = manager.getBannerPosition(a);
|
|
192
|
+
const positionB = manager.getBannerPosition(b);
|
|
193
|
+
|
|
194
|
+
if (positionA !== positionB) {
|
|
195
|
+
return positionA - positionB;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return getSameSlotInsertionOrder(a) - getSameSlotInsertionOrder(b);
|
|
199
|
+
})
|
|
200
|
+
.appendTo(manager.el.productsWrap);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
manager.__bloomreachEmulationPatched = true;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function rebuildBloomreachBannersForEmulation(inputs) {
|
|
207
|
+
const slots = inputs.bloomreachSlots || [];
|
|
208
|
+
const manager = window.Wick?.BannerPlacementManager;
|
|
209
|
+
const productsWrapSelector = manager
|
|
210
|
+
? manager.el.productsWrap
|
|
211
|
+
: '.products-list.products-list-v2';
|
|
212
|
+
const productsWrap = document.querySelector(productsWrapSelector);
|
|
213
|
+
|
|
214
|
+
if (!productsWrap) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const existingBanners = document.querySelectorAll('.card-bloomreach-media-banner');
|
|
219
|
+
|
|
220
|
+
if (isBloomreachDisabled(slots)) {
|
|
221
|
+
existingBanners.forEach((banner) => banner.remove());
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (!existingBanners.length) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const template = existingBanners[0].cloneNode(true);
|
|
230
|
+
|
|
231
|
+
existingBanners.forEach((banner) => banner.remove());
|
|
232
|
+
|
|
233
|
+
const fragment = document.createDocumentFragment();
|
|
234
|
+
|
|
235
|
+
slots.forEach((slot) => {
|
|
236
|
+
if (slot === 0) return;
|
|
237
|
+
|
|
238
|
+
const node = template.cloneNode(true);
|
|
239
|
+
|
|
240
|
+
node.removeAttribute('data-slots');
|
|
241
|
+
setUnifiedPosition(node, slot);
|
|
242
|
+
|
|
243
|
+
fragment.appendChild(node);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
productsWrap.appendChild(fragment);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function applyBloomreachEmulation() {
|
|
250
|
+
const inputs = getInputs();
|
|
251
|
+
|
|
252
|
+
updatePositions(inputs);
|
|
253
|
+
|
|
254
|
+
const isDisabled = isBloomreachDisabled(inputs.bloomreachSlots);
|
|
255
|
+
|
|
256
|
+
toggleHybrisProductBanners(inputs);
|
|
257
|
+
|
|
258
|
+
if (!isDisabled) {
|
|
259
|
+
patchBannerPlacementManagerForBloomreachEmulation(inputs);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
rebuildBloomreachBannersForEmulation(inputs);
|
|
263
|
+
|
|
264
|
+
if (
|
|
265
|
+
window.Wick &&
|
|
266
|
+
window.Wick.BannerPlacementManager &&
|
|
267
|
+
typeof window.Wick.BannerPlacementManager.checkProductsInColumn === 'function'
|
|
268
|
+
) {
|
|
269
|
+
window.Wick.BannerPlacementManager.checkProductsInColumn();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
$(document).ready(function () {
|
|
274
|
+
const manager = window.Wick?.BannerPlacementManager;
|
|
275
|
+
const productsWrapSelector = manager
|
|
276
|
+
? manager.el.productsWrap
|
|
277
|
+
: '.products-list.products-list-v2';
|
|
278
|
+
|
|
279
|
+
if ($(productsWrapSelector).length) {
|
|
280
|
+
setTimeout(() => {
|
|
281
|
+
applyBloomreachEmulation();
|
|
282
|
+
}, 100);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
})();
|
|
@@ -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
|
+
});
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
var Wick = Wick || {};
|
|
2
2
|
Wick.DeliveryDetails = (function () {
|
|
3
|
-
|
|
3
|
+
var $page = $('.page_checkout-delivery-details');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
function bindEvents() {
|
|
6
|
+
var dateAlert;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
$page
|
|
9
|
+
.find(
|
|
10
|
+
'.btn-payment-details, .delivery-details__payment-details, .delivery-details__payment-details_mobile'
|
|
11
|
+
)
|
|
12
|
+
.on('click', function () {
|
|
13
|
+
if (navigator.userAgent.match(/TradeProMobile_Android|DIYMobile_Android/i)) {
|
|
14
|
+
document.body.scrollTop = 0;
|
|
15
|
+
document.documentElement.scrollTop = 0;
|
|
16
|
+
}
|
|
9
17
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
if (!Wick.DateSelection.isDateSelected()) {
|
|
19
|
+
dateAlert = Wick.Notification.show({
|
|
20
|
+
text: 'Sorry, please select a delivery date and/or time',
|
|
21
|
+
container: '.checkout-heading',
|
|
22
|
+
type: 'error',
|
|
23
|
+
});
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
14
27
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
text: 'Sorry, please select a delivery date and/or time',
|
|
18
|
-
container: '.checkout-heading',
|
|
19
|
-
type: 'error'
|
|
28
|
+
$('.date-selection').on('selected', function () {
|
|
29
|
+
dateAlert && dateAlert.hide();
|
|
20
30
|
});
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
});
|
|
31
|
+
}
|
|
24
32
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
33
|
+
if (!$page.length) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
29
36
|
|
|
30
|
-
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
bindEvents();
|
|
37
|
+
bindEvents();
|
|
35
38
|
})();
|