wickes-css2 2.111.0-complete-your-project.7 → 2.111.0-develop.1
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/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_personal-details.css +1 -1
- package/build/css/pages/page_product-details-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-hub.min.js +1 -1
- package/build/js/basket.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/emulation.min.js +60 -2868
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/utils/create-count-stepper.js +9 -30
- package/build/js/pdp-count-stepper.min.js +1 -1
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/build/js/saving-shopping-list.min.js +1 -1
- package/package.json +1 -1
- package/src/components/base/button.hbs +5 -23
- package/src/components/gift-cards.hbs +1 -1
- package/src/elements/checkbox.hbs +1 -8
- package/src/js/components/general/cart-slider.js +6 -19
- package/src/js/emulation/mock.js +1 -3097
- package/src/js/emulation/notify-me.js +1 -1
- package/src/js/page/utils/create-count-stepper.js +9 -30
- package/src/page_product-details-banner.html +1 -0
- package/src/page_product-details-big-wins-disabled-delivery.html +1 -0
- package/src/page_product-details-big-wins-non-registered.html +1 -0
- package/src/page_product-details-big-wins-out-nearest.html +1 -0
- package/src/page_product-details-big-wins-unhappy.html +1 -0
- package/src/page_product-details-big-wins.html +1 -0
- package/src/page_product-details-billie.html +1 -0
- package/src/page_product-details-calculator.html +1 -0
- package/src/page_product-details-cashback-v2.html +1 -0
- package/src/page_product-details-clearpay.html +1 -0
- package/src/page_product-details-cnc-error-notification.html +1 -0
- package/src/page_product-details-cnc-success-notification-vat.html +1 -0
- package/src/page_product-details-cnc-success-notification.html +1 -0
- package/src/page_product-details-default-store.html +1 -0
- package/src/page_product-details-energy-efficiency.html +1 -0
- package/src/page_product-details-flooring-with-pr-placeholder.html +1 -0
- package/src/page_product-details-flooring.html +1 -0
- package/src/page_product-details-gallery-actual.html +1 -0
- package/src/page_product-details-mfe-calculator.html +1 -0
- package/src/page_product-details-minimum-v2.html +1 -0
- package/src/page_product-details-mtm-doors.html +1 -0
- package/src/page_product-details-only-clearpay.html +1 -0
- package/src/page_product-details-paint-mixing.html +1 -0
- package/src/page_product-details-saved-pl.html +1 -0
- package/src/page_product-details-tile-steps-klarna-widget-with-method-ids.html +1 -0
- package/src/page_product-details-tile-steps-logout.html +1 -0
- package/src/page_product-details-tile-steps-no-new-project-list.html +1 -0
- package/src/page_product-details-tile-steps-with-klarna.html +1 -0
- package/src/page_product-details-tile-steps.html +1 -0
- package/src/page_product-details-v2.html +1 -0
- package/src/page_product-details-vat.html +1 -0
- package/src/page_product-details-wisdom-mcfc-registered.html +1 -0
- package/src/page_product-details-wisdom-mcfc.html +1 -0
- package/src/page_product-details-wisdom-oos-registered.html +1 -0
- package/src/page_product-details-wisdom-oos.html +1 -0
- package/src/page_product-details-wisdom-registered.html +1 -0
- package/src/page_product-details-wisdom.html +1 -0
- package/src/page_product-details-with-favourite.html +1 -0
- package/src/page_product-details-with-global-search-v2.html +1 -7
- package/src/page_product-details_no-previous-default.html +1 -0
- package/src/page_track-my-order-result.html +0 -1
- package/src/partials/scripts.hbs +0 -1
- package/src/scss/common/_common.scss +0 -1
- package/src/scss/common/_elements.scss +1 -13
- package/src/scss/components/_notifications.scss +5 -86
- package/src/scss/components/_pdp-action-v2-critical.scss +27 -0
- package/src/scss/components/_pdp-action-v2.scss +27 -0
- package/src/scss/helpers/_variables.scss +0 -1
- package/src/scss/pages/page_product-details-v2.scss +2 -45
- package/src/scss/pdp-main-critical.scss +1 -0
- package/src/scss/pdp-main.scss +1 -1
- package/src/sitemap.html +0 -6
- package/build/js/bloomreach-widget.min.js +0 -1
- package/build/js/page/bloomreach-widget.js +0 -1187
- package/build/js/page/utils/create-loading-button.js +0 -37
- package/build/js/page/utils/create-toast.js +0 -79
- package/build/js/page/utils/custom-dropdown.js +0 -80
- package/src/components/bloomreach/complete-card-dropdown.hbs +0 -47
- package/src/components/bloomreach/complete-card-skeleton.hbs +0 -19
- package/src/components/bloomreach/complete-card.hbs +0 -138
- package/src/components/bloomreach/complete-divider.hbs +0 -3
- package/src/components/bloomreach/complete-summary-skeleton.hbs +0 -12
- package/src/components/bloomreach/complete-summary.hbs +0 -43
- package/src/components/bloomreach/complete-wrapper.hbs +0 -1
- package/src/components/bloomreach/complete-your-project.hbs +0 -21
- package/src/js/emulation/bloomreach-widget-calculations.js +0 -140
- package/src/js/emulation/bloomreach-widget-loading.js +0 -11
- package/src/js/page/bloomreach-widget.js +0 -1187
- package/src/js/page/utils/create-loading-button.js +0 -37
- package/src/js/page/utils/create-toast.js +0 -79
- package/src/js/page/utils/custom-dropdown.js +0 -80
- package/src/page_product-details-bloomreach.html +0 -130
- package/src/scss/common/_loading-button.scss +0 -49
- package/src/scss/components/bloomreach/_bloomreach.scss +0 -3
- package/src/scss/components/bloomreach/_complete-card-dropdown.scss +0 -174
- package/src/scss/components/bloomreach/_complete-card.scss +0 -402
- package/src/scss/components/bloomreach/_complete-your-project.scss +0 -207
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export function createLoadingButton(config = {}) {
|
|
2
|
-
const settings = {
|
|
3
|
-
text: '.loading-button__text',
|
|
4
|
-
loader: '.loading-button__loader',
|
|
5
|
-
loadingClass: 'loading-button--loading',
|
|
6
|
-
...config,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
function setLoading($button, isLoading) {
|
|
10
|
-
if (!$button.length) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
$button.toggleClass(settings.loadingClass, isLoading);
|
|
15
|
-
$button.find(settings.text).toggleClass('d-none', isLoading);
|
|
16
|
-
$button.find(settings.loader).toggleClass('d-none', !isLoading);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function start($button) {
|
|
20
|
-
setLoading($button, true);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function stop($button) {
|
|
24
|
-
setLoading($button, false);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function isLoading($button) {
|
|
28
|
-
return $button.hasClass(settings.loadingClass);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
setLoading,
|
|
33
|
-
start,
|
|
34
|
-
stop,
|
|
35
|
-
isLoading,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export function createToast(config = {}) {
|
|
2
|
-
const settings = {
|
|
3
|
-
containerClass: 'toast-container',
|
|
4
|
-
toastClass: 'toast',
|
|
5
|
-
closeSelector: '.notification__close',
|
|
6
|
-
backdropClass: 'modal-backdrop--toast',
|
|
7
|
-
duration: 3000,
|
|
8
|
-
template: null,
|
|
9
|
-
getData(type, text) {
|
|
10
|
-
return {
|
|
11
|
-
text,
|
|
12
|
-
classModifier: `${settings.toastClass} notification_${type}`,
|
|
13
|
-
success: type === 'success',
|
|
14
|
-
warning: type === 'warning',
|
|
15
|
-
error: type === 'error',
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
...config,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
let closeTimer = null;
|
|
22
|
-
|
|
23
|
-
function clearCloseTimer() {
|
|
24
|
-
if (closeTimer) {
|
|
25
|
-
window.clearTimeout(closeTimer);
|
|
26
|
-
closeTimer = null;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function hide() {
|
|
31
|
-
clearCloseTimer();
|
|
32
|
-
|
|
33
|
-
$(`.${settings.containerClass}`).remove();
|
|
34
|
-
$(`.${settings.backdropClass}`).removeClass(settings.backdropClass);
|
|
35
|
-
|
|
36
|
-
if (window.Wick && Wick.Backdrop) {
|
|
37
|
-
Wick.Backdrop.hide();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
$(document).off('click.toast');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function show({ type = 'success', text = '' }) {
|
|
44
|
-
if (!settings.template) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
hide();
|
|
49
|
-
|
|
50
|
-
const toastHtml = settings.template(settings.getData(type, text));
|
|
51
|
-
|
|
52
|
-
if (window.Wick && Wick.Backdrop) {
|
|
53
|
-
Wick.Backdrop.show();
|
|
54
|
-
$('.modal-backdrop').addClass(settings.backdropClass);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
$('body').append(`<div class="${settings.containerClass}">${toastHtml}</div>`);
|
|
58
|
-
|
|
59
|
-
$(`.${settings.containerClass}`)
|
|
60
|
-
.off('click.toastClose', settings.closeSelector)
|
|
61
|
-
.on('click.toastClose', settings.closeSelector, function (event) {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
hide();
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
$(document)
|
|
67
|
-
.off('click.toast')
|
|
68
|
-
.on('click.toast', `.${settings.backdropClass}`, function () {
|
|
69
|
-
hide();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
closeTimer = window.setTimeout(hide, settings.duration);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
show,
|
|
77
|
-
hide,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
export function createDropdown(config) {
|
|
2
|
-
const settings = {
|
|
3
|
-
root: '[data-dropdown]',
|
|
4
|
-
toggle: '[data-dropdown-toggle]',
|
|
5
|
-
value: '[data-dropdown-value]',
|
|
6
|
-
option: '[data-dropdown-option]',
|
|
7
|
-
openClass: 'dropdown--open',
|
|
8
|
-
selectedClass: 'dropdown__option--selected',
|
|
9
|
-
selectedValueData: 'selected-value',
|
|
10
|
-
ariaExpandedAttr: 'aria-expanded',
|
|
11
|
-
ariaSelectedAttr: 'aria-selected',
|
|
12
|
-
namespace: 'customDropdown',
|
|
13
|
-
onSelect: function () {},
|
|
14
|
-
...config,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
function closeAll() {
|
|
18
|
-
$(settings.root).each(function () {
|
|
19
|
-
const $dropdown = $(this);
|
|
20
|
-
const $toggle = $dropdown.find(settings.toggle);
|
|
21
|
-
|
|
22
|
-
$dropdown.removeClass(settings.openClass);
|
|
23
|
-
$toggle.attr(settings.ariaExpandedAttr, 'false');
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function selectOption($dropdown, $option) {
|
|
28
|
-
const $value = $dropdown.find(settings.value);
|
|
29
|
-
const $options = $dropdown.find(settings.option);
|
|
30
|
-
const selectedValue = $option.attr('data-value') || '';
|
|
31
|
-
|
|
32
|
-
$options.removeClass(settings.selectedClass).attr(settings.ariaSelectedAttr, 'false');
|
|
33
|
-
$option.addClass(settings.selectedClass).attr(settings.ariaSelectedAttr, 'true');
|
|
34
|
-
|
|
35
|
-
if ($value.length) {
|
|
36
|
-
$value.text($option.text().trim());
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
$dropdown.data(settings.selectedValueData, selectedValue);
|
|
40
|
-
|
|
41
|
-
settings.onSelect($dropdown, $option, selectedValue);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function bind() {
|
|
45
|
-
$(document).off(`click.${settings.namespace}`);
|
|
46
|
-
$(document).on(`click.${settings.namespace}`, function (event) {
|
|
47
|
-
const $target = $(event.target);
|
|
48
|
-
const $toggle = $target.closest(settings.toggle);
|
|
49
|
-
const $option = $target.closest(settings.option);
|
|
50
|
-
const $dropdown = $target.closest(settings.root);
|
|
51
|
-
|
|
52
|
-
if (!$dropdown.length) {
|
|
53
|
-
closeAll();
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if ($toggle.length) {
|
|
58
|
-
const isOpen = $dropdown.hasClass(settings.openClass);
|
|
59
|
-
|
|
60
|
-
closeAll();
|
|
61
|
-
|
|
62
|
-
$dropdown.toggleClass(settings.openClass, !isOpen);
|
|
63
|
-
$toggle.attr(settings.ariaExpandedAttr, String(!isOpen));
|
|
64
|
-
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if ($option.length) {
|
|
69
|
-
selectOption($dropdown, $option);
|
|
70
|
-
closeAll();
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
bind,
|
|
77
|
-
closeAll,
|
|
78
|
-
selectOption,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<div class="complete-card-dropdown" data-complete-card-dropdown>
|
|
2
|
-
<button
|
|
3
|
-
class="complete-card-dropdown__toggle"
|
|
4
|
-
type="button"
|
|
5
|
-
aria-haspopup="listbox"
|
|
6
|
-
aria-expanded="false"
|
|
7
|
-
data-complete-card-dropdown-toggle
|
|
8
|
-
>
|
|
9
|
-
<span class="complete-card-dropdown__value" data-complete-card-dropdown-value>
|
|
10
|
-
{{#if selectedLabel}}{{selectedLabel}}{{else}}{{placeholder}}{{/if}}
|
|
11
|
-
</span>
|
|
12
|
-
|
|
13
|
-
<span class="complete-card-dropdown__icon">
|
|
14
|
-
<i class="fas fa-chevron-down"></i>
|
|
15
|
-
</span>
|
|
16
|
-
</button>
|
|
17
|
-
|
|
18
|
-
<div class="complete-card-dropdown__menu" role="listbox">
|
|
19
|
-
<button
|
|
20
|
-
class="complete-card-dropdown__option {{#unless selectedValue}}complete-card-dropdown__option--selected{{/unless}}"
|
|
21
|
-
type="button"
|
|
22
|
-
role="option"
|
|
23
|
-
aria-selected="{{#unless selectedValue}}true{{else}}false{{/unless}}"
|
|
24
|
-
data-value=""
|
|
25
|
-
data-complete-card-dropdown-option
|
|
26
|
-
>
|
|
27
|
-
{{placeholder}}
|
|
28
|
-
</button>
|
|
29
|
-
|
|
30
|
-
{{#each options}}
|
|
31
|
-
<button
|
|
32
|
-
class="complete-card-dropdown__option {{#if selected}}complete-card-dropdown__option--selected{{/if}}"
|
|
33
|
-
type="button"
|
|
34
|
-
role="option"
|
|
35
|
-
aria-selected="{{#if selected}}true{{else}}false{{/if}}"
|
|
36
|
-
data-value="{{value}}"
|
|
37
|
-
data-complete-card-dropdown-option
|
|
38
|
-
>
|
|
39
|
-
{{label}}
|
|
40
|
-
</button>
|
|
41
|
-
{{/each}}
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div class="complete-card-dropdown__error">
|
|
45
|
-
Select required variant
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<div class="card complete-card complete-card--skeleton ssc">
|
|
2
|
-
<div class="complete-card__inner">
|
|
3
|
-
<div class="complete-card__img-wrap">
|
|
4
|
-
<div class="ssc-square complete-card__img"></div>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="complete-card__content">
|
|
7
|
-
<div class="complete-card__header">
|
|
8
|
-
<div class="ssc-line complete-card__skeleton-title"></div>
|
|
9
|
-
<div class="ssc-line complete-card__skeleton-title-short"></div>
|
|
10
|
-
<div class="ssc-line complete-card__skeleton-reviews"></div>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="ssc-line complete-card__skeleton-stepper"></div>
|
|
13
|
-
<div class="complete-card__bottom">
|
|
14
|
-
<div class="ssc-line complete-card__skeleton-price"></div>
|
|
15
|
-
<div class="ssc-line complete-card__skeleton-delivery"></div>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
<div class="card complete-card {{modification}}" data-product-code="{{code}}">
|
|
2
|
-
{{#if badge}}
|
|
3
|
-
<div
|
|
4
|
-
class="complete-card__badge"
|
|
5
|
-
style="background-color: {{badge.color}}; color: {{badge.textColor}};"
|
|
6
|
-
>
|
|
7
|
-
{{badge.text}}
|
|
8
|
-
</div>
|
|
9
|
-
{{/if}}
|
|
10
|
-
|
|
11
|
-
<div class="complete-card__inner">
|
|
12
|
-
<div class="complete-card__select">
|
|
13
|
-
{{> checkbox id=checkboxId action="true" checked=checked name=name}}
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<div class="complete-card__img-wrap">
|
|
17
|
-
{{#if image.url}}
|
|
18
|
-
<img class="complete-card__img" src="{{image.url}}" alt="{{image.altText}}">
|
|
19
|
-
{{/if}}
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<div class="complete-card__content">
|
|
23
|
-
<div class="complete-card__header">
|
|
24
|
-
<a href="{{url}}" target="_blank" class="complete-card__title">
|
|
25
|
-
{{name}}
|
|
26
|
-
</a>
|
|
27
|
-
|
|
28
|
-
<div class="complete-card__reviews">
|
|
29
|
-
<div class="rating-bg">
|
|
30
|
-
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
31
|
-
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
32
|
-
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
33
|
-
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
34
|
-
<i class="fa fa-star star-in" aria-hidden="true"></i>
|
|
35
|
-
|
|
36
|
-
<div class="rating-overlay"
|
|
37
|
-
data-rating="{{#if externalAverageRating}}{{externalAverageRating}}{{else}}0{{/if}}">
|
|
38
|
-
<span class="star-overlay">
|
|
39
|
-
<i class="fa fa-star" aria-hidden="true"></i>
|
|
40
|
-
</span>
|
|
41
|
-
<span class="star-overlay">
|
|
42
|
-
<i class="fa fa-star" aria-hidden="true"></i>
|
|
43
|
-
</span>
|
|
44
|
-
<span class="star-overlay">
|
|
45
|
-
<i class="fa fa-star" aria-hidden="true"></i>
|
|
46
|
-
</span>
|
|
47
|
-
<span class="star-overlay">
|
|
48
|
-
<i class="fa fa-star" aria-hidden="true"></i>
|
|
49
|
-
</span>
|
|
50
|
-
<span class="star-overlay">
|
|
51
|
-
<i class="fa fa-star" aria-hidden="true"></i>
|
|
52
|
-
</span>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<span class="complete-card__reviews-count">
|
|
56
|
-
(<span class="complete-card__reviews-count-value">{{externalReviewCount}}</span>)
|
|
57
|
-
</span>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
<div class="complete-card__options">
|
|
62
|
-
{{#if dropdownOptions.length}}
|
|
63
|
-
{{> bloomreach/complete-card-dropdown
|
|
64
|
-
id=checkboxId
|
|
65
|
-
placeholder="Select option"
|
|
66
|
-
options=dropdownOptions
|
|
67
|
-
selectedValue=selectedDropdownValue
|
|
68
|
-
selectedLabel=selectedDropdownLabel
|
|
69
|
-
error=dropdownError
|
|
70
|
-
}}
|
|
71
|
-
{{/if}}
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<div class="complete-card__count-stepper count-stepper">
|
|
75
|
-
<label for="card-count-{{checkboxId}}" class="quantity-label">
|
|
76
|
-
Quantity:
|
|
77
|
-
</label>
|
|
78
|
-
|
|
79
|
-
<input
|
|
80
|
-
type="text"
|
|
81
|
-
inputmode="numeric"
|
|
82
|
-
required=""
|
|
83
|
-
pattern="[0-9]*\d"
|
|
84
|
-
id="card-count-{{checkboxId}}"
|
|
85
|
-
class="tbx tbx_quantity"
|
|
86
|
-
value="1"
|
|
87
|
-
readonly
|
|
88
|
-
>
|
|
89
|
-
</div>
|
|
90
|
-
|
|
91
|
-
<div class="complete-card__bottom">
|
|
92
|
-
<div class="complete-card__price {{#if wasPriceFormatted}}complete-card__price_sale{{/if}}">
|
|
93
|
-
{{#if showFromPrice}}
|
|
94
|
-
<div class="complete-card__price_from">From</div>
|
|
95
|
-
{{/if}}
|
|
96
|
-
|
|
97
|
-
{{#if wasPriceFormatted}}
|
|
98
|
-
<div class="complete-card__price-value">
|
|
99
|
-
{{#if switch-vat}}
|
|
100
|
-
<span class="including-vat-inherit">{{incVatWasPriceFormatted}}</span>
|
|
101
|
-
<span class="excluding-vat-inherit">{{excVatWasPriceFormatted}}</span>
|
|
102
|
-
{{else}}
|
|
103
|
-
{{wasPriceFormatted}}
|
|
104
|
-
{{/if}}
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<div class="complete-card__price__sale-price">
|
|
108
|
-
{{#if switch-vat}}
|
|
109
|
-
<span class="including-vat-inherit">{{{incVatFormattedValue}}}</span>
|
|
110
|
-
<span class="excluding-vat-inherit">{{{excVatFormattedValue}}}</span>
|
|
111
|
-
{{else}}
|
|
112
|
-
{{{price.formattedValue}}}
|
|
113
|
-
{{/if}}
|
|
114
|
-
</div>
|
|
115
|
-
{{else}}
|
|
116
|
-
<div class="complete-card__price-value">
|
|
117
|
-
{{#if switch-vat}}
|
|
118
|
-
<span class="including-vat-inherit">{{{incVatFormattedValue}}}</span>
|
|
119
|
-
<span class="excluding-vat-inherit">{{{excVatFormattedValue}}}</span>
|
|
120
|
-
{{else}}
|
|
121
|
-
{{{price.formattedValue}}}
|
|
122
|
-
{{/if}}
|
|
123
|
-
</div>
|
|
124
|
-
{{/if}}
|
|
125
|
-
|
|
126
|
-
{{#if switch-vat}}
|
|
127
|
-
<span class="complete-card__vat-label">
|
|
128
|
-
<span class="including-vat-inherit">Inc. VAT</span>
|
|
129
|
-
<span class="excluding-vat-inherit">Exc. VAT</span>
|
|
130
|
-
</span>
|
|
131
|
-
{{/if}}
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<p class="complete-card__delivery">Excluding delivery</p>
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<div class="complete-widget__summary complete-widget__summary--skeleton ssc">
|
|
2
|
-
<div class="complete-widget__summary-wrapper">
|
|
3
|
-
<div class="complete-widget__total">
|
|
4
|
-
<div class="ssc-line complete-widget__skeleton-label"></div>
|
|
5
|
-
<div class="ssc-line complete-widget__skeleton-price"></div>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="complete-widget__cta">
|
|
8
|
-
<div class="ssc-square complete-widget__skeleton-cta"></div>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="ssc-line complete-widget__skeleton-offer"></div>
|
|
12
|
-
</div>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<div class="complete-widget__summary">
|
|
2
|
-
<div class="complete-widget__summary-wrapper">
|
|
3
|
-
<div class="complete-widget__total">
|
|
4
|
-
<div class="complete-widget__label">Total price:</div>
|
|
5
|
-
|
|
6
|
-
<div class="complete-widget__price">
|
|
7
|
-
<div class="complete-widget__price-value">
|
|
8
|
-
{{#if switch-vat}}
|
|
9
|
-
<span class="including-vat-inherit">£0.00</span>
|
|
10
|
-
<span class="excluding-vat-inherit">£0.00</span>
|
|
11
|
-
{{else}}
|
|
12
|
-
£0.00
|
|
13
|
-
{{/if}}
|
|
14
|
-
</div>
|
|
15
|
-
<div class="complete-widget__sale-price" style="display: none;">
|
|
16
|
-
{{#if switch-vat}}
|
|
17
|
-
<span class="including-vat-inherit"></span>
|
|
18
|
-
<span class="excluding-vat-inherit"></span>
|
|
19
|
-
{{/if}}
|
|
20
|
-
</div>
|
|
21
|
-
{{#if switch-vat}}
|
|
22
|
-
<span class="complete-widget__vat-label including-vat-inherit">Inc. VAT</span>
|
|
23
|
-
<span class="complete-widget__vat-label excluding-vat-inherit">Exc. VAT</span>
|
|
24
|
-
{{/if}}
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<div class="complete-widget__cta">
|
|
29
|
-
{{> button
|
|
30
|
-
text="Add selected 1 product to basket"
|
|
31
|
-
full=true
|
|
32
|
-
action=true
|
|
33
|
-
type="button"
|
|
34
|
-
showLoader=true
|
|
35
|
-
loaderModifier="complete-widget__button-loader"
|
|
36
|
-
}}
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<p class="complete-widget__offer">
|
|
41
|
-
*Any offers/discounts will be applied in basket
|
|
42
|
-
</p>
|
|
43
|
-
</div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<div class="complete-widget__wrapper" data-complete-widget-wrapper></div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<div class="complete-widget">
|
|
2
|
-
<h3 class="complete-widget__title text-center">
|
|
3
|
-
{{#if title}}{{title}}{{else}}Complete your project{{/if}}
|
|
4
|
-
</h3>
|
|
5
|
-
|
|
6
|
-
<div class="complete-widget__content" data-complete-widget-content>
|
|
7
|
-
<div class="complete-widget__wrapper">
|
|
8
|
-
{{> bloomreach/complete-card-skeleton}}
|
|
9
|
-
|
|
10
|
-
<div class="complete-widget__divider">
|
|
11
|
-
<i class="fal fa-plus"></i>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
{{> bloomreach/complete-card-skeleton}}
|
|
15
|
-
{{> bloomreach/complete-card-skeleton}}
|
|
16
|
-
{{> bloomreach/complete-card-skeleton}}
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
{{> bloomreach/complete-summary-skeleton}}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
@@ -1,140 +0,0 @@
|
|
|
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 ({ originalEvent }) {
|
|
121
|
-
const entries = originalEvent.detail.entries || [];
|
|
122
|
-
|
|
123
|
-
setTimeout(function () {
|
|
124
|
-
const response = getAddProductBundleResponse(entries);
|
|
125
|
-
|
|
126
|
-
window.dispatchEvent(
|
|
127
|
-
new CustomEvent('productAddedToCart', {
|
|
128
|
-
detail: {
|
|
129
|
-
bulkAddToCartData: response.bulkAddToCartData,
|
|
130
|
-
},
|
|
131
|
-
})
|
|
132
|
-
);
|
|
133
|
-
}, 1200);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
$(document).ready(function () {
|
|
138
|
-
bindCalculateProductBundleTotalEvent();
|
|
139
|
-
bindAddProductBundleToCartEvent();
|
|
140
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
});
|