wickes-css2 2.109.0-develop.2 → 2.109.0-develop.4
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/homepage-main.css +1 -1
- package/build/css/kitchen-plp-main.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/my-account-main-v2.css +1 -1
- package/build/css/my-account-main.css +1 -1
- package/build/css/pages/page_checkout_delivery-new.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/pdp-main-before-combine.css +1 -1
- package/build/css/pdp-main-critical.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/pdp-main.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/css/store-locator-main.css +1 -1
- package/build/js/basket.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/emulation.min.js +490 -56
- package/build/js/gift-cards.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/mini-basket-slider.min.js +1 -1
- package/build/js/page/basket/mini-basket-total.js +17 -2
- package/build/js/page/basket-v2.js +30 -26
- package/build/js/page/components/notify-me.js +99 -0
- package/build/js/page/components/order-summary.js +35 -0
- package/build/js/pdp.bundle.min.js +2 -1
- package/build/js/wickes-dc.js +1 -0
- package/package.json +1 -3
- package/src/components/base/button.hbs +1 -1
- package/src/components/card_product_banner_v2.hbs +4 -1
- package/src/components/card_sponsor_banner.hbs +4 -1
- package/src/components/checkout_order-summary-new.hbs +10 -1
- 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/injected-content.hbs +6 -1
- package/src/components/modal.hbs +1 -1
- package/src/components/modals/notify-me-modal.hbs +76 -0
- package/src/components/order-item.hbs +7 -7
- package/src/components/order-summary.hbs +2 -2
- package/src/components/potential-promotion.hbs +4 -4
- package/src/components/price-block-v2.hbs +211 -214
- package/src/components/sponsor-top-banner.hbs +10 -0
- package/src/data/data_delivery-address-v2.json +1 -1
- package/src/data/data_search-results_v2.json +9 -2
- package/src/data/data_shopping-cart-v2.json +46 -2
- package/src/data/data_shopping-cart-with-energy.json +26 -2
- package/src/data/data_spr_injected_content.json +4 -0
- package/src/js/emulation/basket-data.js +312 -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/mini-basket-data.js +3 -3
- package/src/js/emulation/notify-me.js +9 -0
- package/src/js/emulation/switchCalendar.js +12 -8
- package/src/js/page/basket/mini-basket-total.js +17 -2
- package/src/js/page/basket-v2.js +30 -26
- package/src/js/page/components/notify-me.js +99 -0
- package/src/js/page/components/order-summary.js +35 -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_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_v2.html +1 -0
- package/src/page_product-details-mfe-calculator.html +9 -3
- package/src/scss/common/_CTAs.scss +7 -3
- 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/_notify-me-modal.scss +139 -0
- package/src/scss/components/_order-summary.scss +25 -12
- package/src/scss/components/_price-block-critical.scss +2 -2
- package/src/scss/components/_price-block.scss +14 -4
- package/src/scss/components/card-product-banner.scss +8 -0
- package/src/scss/helpers/_CTAs.scss +15 -5
- package/src/scss/pages/page_checkout_delivery-new.scss +36 -0
- 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/pdp-main.scss +1 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { showValidationErrors, clearValidationErrors, isValidEmail } from '../utils/validation';
|
|
2
|
+
|
|
3
|
+
var Wick = window.Wick || {};
|
|
4
|
+
|
|
5
|
+
Wick.NotifyMeSubscription = {
|
|
6
|
+
NOTIFY_ME_EVENT: 'NOTIFY_ME',
|
|
7
|
+
HIDDEN_CLASS_NAME: 'd-none',
|
|
8
|
+
el: {
|
|
9
|
+
notifyMePopup: '#modal-notify-me',
|
|
10
|
+
notifyMeBtn: '.btn--notify-open',
|
|
11
|
+
|
|
12
|
+
form: '#modal-notify-me .notify-me-form',
|
|
13
|
+
emailInput: '#modal-notify-me #notify-me-email',
|
|
14
|
+
stateForm: '#modal-notify-me [data-notify-state="form"]',
|
|
15
|
+
stateSuccess: '#modal-notify-me [data-notify-state="success"]',
|
|
16
|
+
headerForm: '#modal-notify-me [data-notify-header="form"]',
|
|
17
|
+
headerSuccess: '#modal-notify-me [data-notify-header="success"]',
|
|
18
|
+
productId: '#product-code-val',
|
|
19
|
+
},
|
|
20
|
+
defaultErrorMessage: 'Something went wrong',
|
|
21
|
+
invalidEmailMessage: 'Please enter a valid email address',
|
|
22
|
+
showCustomModal() {
|
|
23
|
+
$(Wick.NotifyMeSubscription.el.notifyMePopup).modal('show');
|
|
24
|
+
},
|
|
25
|
+
getEmail() {
|
|
26
|
+
return ($(Wick.NotifyMeSubscription.el.emailInput).val() || '').toString().trim();
|
|
27
|
+
},
|
|
28
|
+
isEmailValid() {
|
|
29
|
+
const email = Wick.NotifyMeSubscription.getEmail();
|
|
30
|
+
|
|
31
|
+
return isValidEmail(email);
|
|
32
|
+
},
|
|
33
|
+
showFormState() {
|
|
34
|
+
$(Wick.NotifyMeSubscription.el.stateSuccess).addClass(
|
|
35
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
36
|
+
);
|
|
37
|
+
$(Wick.NotifyMeSubscription.el.stateForm).removeClass(
|
|
38
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
$(Wick.NotifyMeSubscription.el.headerSuccess).addClass(
|
|
42
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
43
|
+
);
|
|
44
|
+
$(Wick.NotifyMeSubscription.el.headerForm).removeClass(
|
|
45
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
46
|
+
);
|
|
47
|
+
},
|
|
48
|
+
showSuccessState() {
|
|
49
|
+
$(Wick.NotifyMeSubscription.el.stateForm).addClass(
|
|
50
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
51
|
+
);
|
|
52
|
+
$(Wick.NotifyMeSubscription.el.stateSuccess).removeClass(
|
|
53
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
$(Wick.NotifyMeSubscription.el.headerForm).addClass(
|
|
57
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
58
|
+
);
|
|
59
|
+
$(Wick.NotifyMeSubscription.el.headerSuccess).removeClass(
|
|
60
|
+
Wick.NotifyMeSubscription.HIDDEN_CLASS_NAME
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
resetValidation() {
|
|
64
|
+
clearValidationErrors(Wick.NotifyMeSubscription.el.form);
|
|
65
|
+
},
|
|
66
|
+
validateForm() {
|
|
67
|
+
Wick.NotifyMeSubscription.resetValidation();
|
|
68
|
+
|
|
69
|
+
if (!Wick.NotifyMeSubscription.isEmailValid()) {
|
|
70
|
+
showValidationErrors(
|
|
71
|
+
Wick.NotifyMeSubscription.el.form,
|
|
72
|
+
Wick.NotifyMeSubscription.invalidEmailMessage
|
|
73
|
+
);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return true;
|
|
78
|
+
},
|
|
79
|
+
showError(err = {}) {
|
|
80
|
+
const msg = err.errMsg || err.errorMessage || Wick.NotifyMeSubscription.defaultErrorMessage;
|
|
81
|
+
|
|
82
|
+
showValidationErrors(Wick.NotifyMeSubscription.el.form, msg);
|
|
83
|
+
},
|
|
84
|
+
init() {
|
|
85
|
+
$(document).on('click', Wick.NotifyMeSubscription.el.notifyMeBtn, function (e) {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
Wick.NotifyMeSubscription.showCustomModal();
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
$(Wick.NotifyMeSubscription.el.notifyMePopup).on('hidden.bs.modal', function () {
|
|
91
|
+
Wick.NotifyMeSubscription.showFormState();
|
|
92
|
+
clearValidationErrors(Wick.NotifyMeSubscription.el.form);
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
$(document).ready(function () {
|
|
98
|
+
Wick.NotifyMeSubscription.init();
|
|
99
|
+
});
|
|
@@ -5,6 +5,7 @@ const osEl = {
|
|
|
5
5
|
checkoutWidgetDetailsDiscount: '.checkout-widget__details-discount',
|
|
6
6
|
checkoutWidgetDetails: '.checkout-widget__details',
|
|
7
7
|
delivery: '.checkout-widget__item-delivery',
|
|
8
|
+
deliveryCostMessage: '.checkout-widget__item-delivery-cost-message',
|
|
8
9
|
cc: '.checkout-widget__item-cc',
|
|
9
10
|
itemFree: '.checkout-widget__item-free',
|
|
10
11
|
itemDeficit: '.checkout-widget__item-deficit',
|
|
@@ -26,6 +27,22 @@ export function updateOrderSummary(data, equalMap, isVoucher) {
|
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
if (obj.item === osEl.delivery) {
|
|
31
|
+
$(osEl.delivery).each(function () {
|
|
32
|
+
if (
|
|
33
|
+
!$(this).siblings(osEl.deliveryCostMessage).length &&
|
|
34
|
+
!$(this).closest('[data-hide-delivery-cost-message]').length
|
|
35
|
+
) {
|
|
36
|
+
$(this).after(`
|
|
37
|
+
<li class="checkout-widget__item checkout-widget__item-delivery-cost-message">
|
|
38
|
+
<span class="checkout-widget__item-value" id="order-delivery-cost-message">
|
|
39
|
+
Final delivery cost confirmed at checkout
|
|
40
|
+
</span>
|
|
41
|
+
</li>`);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
29
46
|
$(obj.item).find(obj.itemValue).text(obj.dataValue);
|
|
30
47
|
if (isVoucher ? obj.dataValue : obj.value && obj.dataValue) {
|
|
31
48
|
$(obj.item).find(obj.itemValue).show();
|
|
@@ -64,20 +81,37 @@ export function updateOrderSummary(data, equalMap, isVoucher) {
|
|
|
64
81
|
}
|
|
65
82
|
|
|
66
83
|
function createCheckoutWidgetItem(obj) {
|
|
84
|
+
const isDelivery = obj.item === osEl.delivery;
|
|
85
|
+
const hideMessage = $(osEl.checkoutWidgetDetails).closest(
|
|
86
|
+
'[data-hide-delivery-cost-message]'
|
|
87
|
+
).length;
|
|
88
|
+
const costMessageExists = $(osEl.deliveryCostMessage).length > 0;
|
|
67
89
|
return `
|
|
68
90
|
<li class="checkout-widget__item ${obj.item.substr(1)}">
|
|
69
91
|
<span>${obj.title}</span>
|
|
70
92
|
<span class="checkout-widget__item-value">${obj.dataValue}</span>
|
|
71
93
|
</li>
|
|
94
|
+
${
|
|
95
|
+
isDelivery && !hideMessage && !costMessageExists
|
|
96
|
+
? `
|
|
97
|
+
<li class="checkout-widget__item checkout-widget__item-delivery-cost-message">
|
|
98
|
+
<span class="checkout-widget__item-value" id="order-delivery-cost-message">
|
|
99
|
+
Final delivery cost confirmed at checkout
|
|
100
|
+
</span>
|
|
101
|
+
</li>`
|
|
102
|
+
: ''
|
|
103
|
+
}
|
|
72
104
|
`;
|
|
73
105
|
}
|
|
74
106
|
|
|
75
107
|
function hideUnusedDeliveryTypeCost(data, isVoucher) {
|
|
76
108
|
$(osEl.delivery).show();
|
|
109
|
+
$(osEl.deliveryCostMessage).show();
|
|
77
110
|
$(osEl.cc).show();
|
|
78
111
|
if (isVoucher) {
|
|
79
112
|
if ('deliveryOrder' in data && data.deliveryOrder === false) {
|
|
80
113
|
$(osEl.delivery).hide();
|
|
114
|
+
$(osEl.deliveryCostMessage).hide();
|
|
81
115
|
}
|
|
82
116
|
|
|
83
117
|
if ('clickAndCollectOrder' in data && data.clickAndCollectOrder === false) {
|
|
@@ -86,6 +120,7 @@ function hideUnusedDeliveryTypeCost(data, isVoucher) {
|
|
|
86
120
|
} else {
|
|
87
121
|
if (data.clickAndCollectOnly) {
|
|
88
122
|
$(osEl.delivery).hide();
|
|
123
|
+
$(osEl.deliveryCostMessage).hide();
|
|
89
124
|
} else if (data.deliveryItemsQuantity > 0 && data.pickupItemsQuantity === 0) {
|
|
90
125
|
$(osEl.cc).hide();
|
|
91
126
|
}
|