| @@ -17,7 +17,8 @@ $(document).ready(function() { | |||||
| dpInput.prop('disabled', true); | dpInput.prop('disabled', true); | ||||
| dpInput.wrap('<div class="spwn-date-wrapper"></div>'); | dpInput.wrap('<div class="spwn-date-wrapper"></div>'); | ||||
| $("<span id='spwn-remove-date' title='Zurücksetzen'></span>").insertAfter(dpInput); | $("<span id='spwn-remove-date' title='Zurücksetzen'></span>").insertAfter(dpInput); | ||||
| $("<div id='spwn-delivery'><p></p><div class='spwn-delivery--time'></div></div>").insertAfter(".confirm-delivery-date"); | |||||
| let doNotShow = $(".do-not-show").length ? " class='do-not-show'" : ""; | |||||
| $("<div id='spwn-delivery'" + doNotShow + "><p></p><div class='spwn-delivery--time'></div></div>").insertAfter(".confirm-delivery-date"); | |||||
| fp.config.onChange.push(function() { | fp.config.onChange.push(function() { | ||||
| manipulateDateInputValue(); | manipulateDateInputValue(); | ||||
| }); | }); | ||||
| @@ -37,7 +38,11 @@ $(document).ready(function() { | |||||
| }); | }); | ||||
| /* Set first selectable day selected */ | /* Set first selectable day selected */ | ||||
| setDateSelected(); | |||||
| spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val(); | |||||
| if (spawnDateInputValue === '') { | |||||
| setDateSelected(); | |||||
| } | |||||
| changeDelivery(fp); | changeDelivery(fp); | ||||
| } | } | ||||
| @@ -93,24 +98,16 @@ function manipulateDateInputValue() { | |||||
| function setDateSelected() { | function setDateSelected() { | ||||
| let spwnFirstSelectableDay = $(".flatpickr-day:not(.flatpickr-disabled)").first().text(); | let spwnFirstSelectableDay = $(".flatpickr-day:not(.flatpickr-disabled)").first().text(); | ||||
| let spwnFPdate = new Date(); | let spwnFPdate = new Date(); | ||||
| let spwnDay = spwnFPdate.getDate(); | let spwnDay = spwnFPdate.getDate(); | ||||
| let spwnMonth = spwnFPdate.getMonth(); | let spwnMonth = spwnFPdate.getMonth(); | ||||
| let spwnMonthTemp = 0; | |||||
| // month +1 (january == 0) | |||||
| spwnMonth = spwnMonth + 1; | spwnMonth = spwnMonth + 1; | ||||
| if((String(spwnMonth)).length === 1) { | |||||
| spwnMonthTemp = spwnMonth; | |||||
| spwnMonth = '0' + spwnMonth; | |||||
| } | |||||
| if (spwnFirstSelectableDay < spwnDay) { | if (spwnFirstSelectableDay < spwnDay) { | ||||
| spwnMonth = spwnMonthTemp + 1; | |||||
| if((String(spwnMonth)).length === 1) { | |||||
| spwnMonth = '0' + spwnMonth; | |||||
| } | |||||
| // if selectable day in next month add +1 to month | |||||
| spwnMonth = spwnMonth + 1; | |||||
| } | } | ||||
| let spwnFrmattedDate = spwnFPdate.getFullYear() + '/' + spwnMonth + '/' + spwnFirstSelectableDay; | let spwnFrmattedDate = spwnFPdate.getFullYear() + '/' + spwnMonth + '/' + spwnFirstSelectableDay; | ||||
| fp.setDate(new Date(spwnFrmattedDate)); | |||||
| fp.setDate(new Date(spwnFrmattedDate), true); | |||||
| spawnDateInputValue = spwnFirstSelectableDay + '.' + spwnMonth + '.' + spwnFPdate.getFullYear(); | spawnDateInputValue = spwnFirstSelectableDay + '.' + spwnMonth + '.' + spwnFPdate.getFullYear(); | ||||
| } | } | ||||
| @@ -153,8 +150,8 @@ function changeDelivery(fp) { | |||||
| if (spawnDateInputValue === "" || spawnDateInputValue.indexOf("Uhr") === -1) { | if (spawnDateInputValue === "" || spawnDateInputValue.indexOf("Uhr") === -1) { | ||||
| manipulateDateInputValue(); | manipulateDateInputValue(); | ||||
| } | } | ||||
| // If DPD date is not in Abendzustellung range | |||||
| } else { | } else { | ||||
| // If DPD date is not in Abendzustellung range | |||||
| setDateSelected(); | setDateSelected(); | ||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -86,11 +86,20 @@ | |||||
| border-radius: 3px; | border-radius: 3px; | ||||
| background: rgba(#86B04B, 0.15); | background: rgba(#86B04B, 0.15); | ||||
| color: #86B04B; | color: #86B04B; | ||||
| &.spwn-c-p-more { | |||||
| background-color: #33548c; | |||||
| color: #fff; | |||||
| } | |||||
| .icon { | .icon { | ||||
| min-width: 22px; | min-width: 22px; | ||||
| align-self: auto; | align-self: auto; | ||||
| color: #86B04B; | color: #86B04B; | ||||
| } | } | ||||
| &.spwn-c-p-more { | |||||
| .icon { | |||||
| color: #fff; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| .cart-item { | .cart-item { | ||||
| &.is-discountable-item { | &.is-discountable-item { | ||||
| @@ -179,6 +179,6 @@ input.custom-number[type=number] { | |||||
| } | } | ||||
| .confirm-delivery-date.do-not-show, | .confirm-delivery-date.do-not-show, | ||||
| #spwn-delivery { | |||||
| #spwn-delivery.do-not-show { | |||||
| display: none !important; | display: none !important; | ||||
| } | } | ||||
| @@ -4,7 +4,8 @@ | |||||
| {% set listPrice = price.listPrice %} | {% set listPrice = price.listPrice %} | ||||
| <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | ||||
| {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} | |||||
| {{ price.unitPrice|currency }} | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </p> | </p> | ||||
| {% set weekProductCount = 0 %} | {% set weekProductCount = 0 %} | ||||
| @@ -43,4 +44,21 @@ | |||||
| {% endblock %} | {% endblock %} | ||||
| {% endblock %} | {% endblock %} | ||||
| {% endif %} | {% endif %} | ||||
| {% endblock %} | |||||
| {% block buy_widget_price_unit %} | |||||
| <div class="product-detail-price-unit"> | |||||
| {{ block ('buy_widget_price_unit_label') }} | |||||
| {{ block ('buy_widget_price_unit_content') }} | |||||
| {% if price.referencePrice is not null %} | |||||
| {% block buy_widget_price_unit_reference_content %} | |||||
| <span class="price-unit-reference-content"> | |||||
| ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </span> | |||||
| {% endblock %} | |||||
| {% endif %} | |||||
| </div> | |||||
| {% endblock %} | {% endblock %} | ||||
| @@ -17,14 +17,16 @@ | |||||
| {% endfor %} | {% endfor %} | ||||
| <div class="offcanvas-cart-items"> | <div class="offcanvas-cart-items"> | ||||
| {# spawntree start #} | {# spawntree start #} | ||||
| {% if customizedProductsCount == 1 || customizedProductsCount == 2 %} | |||||
| <div class="spwn-customized-products"> | |||||
| {% if customizedProductsCount == 1 || customizedProductsCount == 2 || customizedProductsCount > 3 %} | |||||
| <div class="spwn-customized-products{% if customizedProductsCount > 3 %} spwn-c-p-more{% endif %}"> | |||||
| {% sw_icon 'checkmark-circle' %} | {% sw_icon 'checkmark-circle' %} | ||||
| <div class="spwn-customized-products--text"> | <div class="spwn-customized-products--text"> | ||||
| {% if customizedProductsCount == 1 %} | {% if customizedProductsCount == 1 %} | ||||
| {{ "checkout.diaekoProgramNoticeFirst"|trans|sw_sanitize }} | {{ "checkout.diaekoProgramNoticeFirst"|trans|sw_sanitize }} | ||||
| {% elseif customizedProductsCount == 2 %} | {% elseif customizedProductsCount == 2 %} | ||||
| {{ "checkout.diaekoProgramNoticeSecond"|trans|sw_sanitize }} | {{ "checkout.diaekoProgramNoticeSecond"|trans|sw_sanitize }} | ||||
| {% elseif customizedProductsCount > 3 %} | |||||
| {{ "checkout.diaekoProgramNoticeMore"|trans|sw_sanitize }} | |||||
| {% endif %} | {% endif %} | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -4,7 +4,8 @@ | |||||
| {% set listPrice = price.listPrice %} | {% set listPrice = price.listPrice %} | ||||
| <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | ||||
| {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} | |||||
| {{ price.unitPrice|currency }} | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </p> | </p> | ||||
| {% if listPrice.percentage > 0 %} | {% if listPrice.percentage > 0 %} | ||||
| @@ -32,4 +33,22 @@ | |||||
| {% endblock %} | {% endblock %} | ||||
| {% endblock %} | {% endblock %} | ||||
| {% endif %} | {% endif %} | ||||
| {% endblock %} | |||||
| {% endblock %} | |||||
| {% block page_product_detail_price_unit %} | |||||
| <div class="product-detail-price-unit"> | |||||
| {{ block ('page_product_detail_price_unit_label') }} | |||||
| {{ block ('page_product_detail_price_unit_content') }} | |||||
| {% if price.referencePrice is not null %} | |||||
| {% block page_product_detail_price_unit_reference_content %} | |||||
| <span class="price-unit-reference-content"> | |||||
| ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </span> | |||||
| {% endblock %} | |||||
| {% endif %} | |||||
| </div> | |||||
| {% endblock %} | |||||
| @@ -17,7 +17,8 @@ $(document).ready(function() { | |||||
| dpInput.prop('disabled', true); | dpInput.prop('disabled', true); | ||||
| dpInput.wrap('<div class="spwn-date-wrapper"></div>'); | dpInput.wrap('<div class="spwn-date-wrapper"></div>'); | ||||
| $("<span id='spwn-remove-date' title='Zurücksetzen'></span>").insertAfter(dpInput); | $("<span id='spwn-remove-date' title='Zurücksetzen'></span>").insertAfter(dpInput); | ||||
| $("<div id='spwn-delivery'><p></p><div class='spwn-delivery--time'></div></div>").insertAfter(".confirm-delivery-date"); | |||||
| let doNotShow = $(".do-not-show").length ? " class='do-not-show'" : ""; | |||||
| $("<div id='spwn-delivery'" + doNotShow + "><p></p><div class='spwn-delivery--time'></div></div>").insertAfter(".confirm-delivery-date"); | |||||
| fp.config.onChange.push(function() { | fp.config.onChange.push(function() { | ||||
| manipulateDateInputValue(); | manipulateDateInputValue(); | ||||
| }); | }); | ||||
| @@ -37,7 +38,11 @@ $(document).ready(function() { | |||||
| }); | }); | ||||
| /* Set first selectable day selected */ | /* Set first selectable day selected */ | ||||
| setDateSelected(); | |||||
| spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val(); | |||||
| if (spawnDateInputValue === '') { | |||||
| setDateSelected(); | |||||
| } | |||||
| changeDelivery(fp); | changeDelivery(fp); | ||||
| } | } | ||||
| @@ -93,24 +98,16 @@ function manipulateDateInputValue() { | |||||
| function setDateSelected() { | function setDateSelected() { | ||||
| let spwnFirstSelectableDay = $(".flatpickr-day:not(.flatpickr-disabled)").first().text(); | let spwnFirstSelectableDay = $(".flatpickr-day:not(.flatpickr-disabled)").first().text(); | ||||
| let spwnFPdate = new Date(); | let spwnFPdate = new Date(); | ||||
| let spwnDay = spwnFPdate.getDate(); | let spwnDay = spwnFPdate.getDate(); | ||||
| let spwnMonth = spwnFPdate.getMonth(); | let spwnMonth = spwnFPdate.getMonth(); | ||||
| let spwnMonthTemp = 0; | |||||
| // month +1 (january == 0) | |||||
| spwnMonth = spwnMonth + 1; | spwnMonth = spwnMonth + 1; | ||||
| if((String(spwnMonth)).length === 1) { | |||||
| spwnMonthTemp = spwnMonth; | |||||
| spwnMonth = '0' + spwnMonth; | |||||
| } | |||||
| if (spwnFirstSelectableDay < spwnDay) { | if (spwnFirstSelectableDay < spwnDay) { | ||||
| spwnMonth = spwnMonthTemp + 1; | |||||
| if((String(spwnMonth)).length === 1) { | |||||
| spwnMonth = '0' + spwnMonth; | |||||
| } | |||||
| // if selectable day in next month add +1 to month | |||||
| spwnMonth = spwnMonth + 1; | |||||
| } | } | ||||
| let spwnFrmattedDate = spwnFPdate.getFullYear() + '/' + spwnMonth + '/' + spwnFirstSelectableDay; | let spwnFrmattedDate = spwnFPdate.getFullYear() + '/' + spwnMonth + '/' + spwnFirstSelectableDay; | ||||
| fp.setDate(new Date(spwnFrmattedDate)); | |||||
| fp.setDate(new Date(spwnFrmattedDate), true); | |||||
| spawnDateInputValue = spwnFirstSelectableDay + '.' + spwnMonth + '.' + spwnFPdate.getFullYear(); | spawnDateInputValue = spwnFirstSelectableDay + '.' + spwnMonth + '.' + spwnFPdate.getFullYear(); | ||||
| } | } | ||||
| @@ -153,8 +150,8 @@ function changeDelivery(fp) { | |||||
| if (spawnDateInputValue === "" || spawnDateInputValue.indexOf("Uhr") === -1) { | if (spawnDateInputValue === "" || spawnDateInputValue.indexOf("Uhr") === -1) { | ||||
| manipulateDateInputValue(); | manipulateDateInputValue(); | ||||
| } | } | ||||
| // If DPD date is not in Abendzustellung range | |||||
| } else { | } else { | ||||
| // If DPD date is not in Abendzustellung range | |||||
| setDateSelected(); | setDateSelected(); | ||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -92,11 +92,20 @@ | |||||
| border-radius: 3px; | border-radius: 3px; | ||||
| background: rgba(#86B04B, 0.15); | background: rgba(#86B04B, 0.15); | ||||
| color: #86B04B; | color: #86B04B; | ||||
| &.spwn-c-p-more { | |||||
| background-color: #86b04b; | |||||
| color: #272527; | |||||
| } | |||||
| .icon { | .icon { | ||||
| min-width: 22px; | min-width: 22px; | ||||
| align-self: auto; | align-self: auto; | ||||
| color: #86B04B; | color: #86B04B; | ||||
| } | } | ||||
| &.spwn-c-p-more { | |||||
| .icon { | |||||
| color: #272527; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| .cart-item { | .cart-item { | ||||
| &.is-discountable-item { | &.is-discountable-item { | ||||
| @@ -167,6 +167,6 @@ input.custom-number[type=number] { | |||||
| } | } | ||||
| .confirm-delivery-date.do-not-show, | .confirm-delivery-date.do-not-show, | ||||
| #spwn-delivery { | |||||
| #spwn-delivery.do-not-show { | |||||
| display: none !important; | display: none !important; | ||||
| } | } | ||||
| @@ -4,7 +4,8 @@ | |||||
| {% set listPrice = price.listPrice %} | {% set listPrice = price.listPrice %} | ||||
| <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | ||||
| {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} | |||||
| {{ price.unitPrice|currency }} | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </p> | </p> | ||||
| {% set weekProductCount = 0 %} | {% set weekProductCount = 0 %} | ||||
| @@ -43,4 +44,21 @@ | |||||
| {% endblock %} | {% endblock %} | ||||
| {% endblock %} | {% endblock %} | ||||
| {% endif %} | {% endif %} | ||||
| {% endblock %} | |||||
| {% block buy_widget_price_unit %} | |||||
| <div class="product-detail-price-unit"> | |||||
| {{ block ('buy_widget_price_unit_label') }} | |||||
| {{ block ('buy_widget_price_unit_content') }} | |||||
| {% if price.referencePrice is not null %} | |||||
| {% block buy_widget_price_unit_reference_content %} | |||||
| <span class="price-unit-reference-content"> | |||||
| ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </span> | |||||
| {% endblock %} | |||||
| {% endif %} | |||||
| </div> | |||||
| {% endblock %} | {% endblock %} | ||||
| @@ -4,7 +4,8 @@ | |||||
| {% set listPrice = price.listPrice %} | {% set listPrice = price.listPrice %} | ||||
| <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | <p class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}"> | ||||
| {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} | |||||
| {{ price.unitPrice|currency }} | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </p> | </p> | ||||
| {% if listPrice.percentage > 0 %} | {% if listPrice.percentage > 0 %} | ||||
| @@ -32,4 +33,21 @@ | |||||
| {% endblock %} | {% endblock %} | ||||
| {% endblock %} | {% endblock %} | ||||
| {% endif %} | {% endif %} | ||||
| {% endblock %} | |||||
| {% block page_product_detail_price_unit %} | |||||
| <div class="product-detail-price-unit"> | |||||
| {{ block ('page_product_detail_price_unit_label') }} | |||||
| {{ block ('page_product_detail_price_unit_content') }} | |||||
| {% if price.referencePrice is not null %} | |||||
| {% block page_product_detail_price_unit_reference_content %} | |||||
| <span class="price-unit-reference-content"> | |||||
| ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) | |||||
| {# {{ "general.star"|trans|sw_sanitize }}#} | |||||
| </span> | |||||
| {% endblock %} | |||||
| {% endif %} | |||||
| </div> | |||||
| {% endblock %} | {% endblock %} | ||||