From 713becf4e63fb453f7b9cb747eb99b3cce15bd7c Mon Sep 17 00:00:00 2001 From: Florian Eisenmenger Date: Wed, 30 Mar 2022 13:53:32 +0200 Subject: [PATCH] changes --- .../js/zenit-platform-atmos-set1.js | 27 +++++++++---------- .../storefront/src/scss/component/_card.scss | 9 +++++++ .../app/storefront/src/scss/overrides.scss | 2 +- .../buy-widget/buy-widget-price.html.twig | 20 +++++++++++++- .../checkout/offcanvas-cart.html.twig | 6 +++-- .../product-detail/buy-widget-price.html.twig | 23 ++++++++++++++-- .../js/zenit-platform-atmos-set2.js | 27 +++++++++---------- .../storefront/src/scss/component/_card.scss | 9 +++++++ .../app/storefront/src/scss/overrides.scss | 2 +- .../buy-widget/buy-widget-price.html.twig | 20 +++++++++++++- .../product-detail/buy-widget-price.html.twig | 20 +++++++++++++- 11 files changed, 126 insertions(+), 39 deletions(-) diff --git a/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js b/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js index df585e7..a9c3325 100644 --- a/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js +++ b/zenitPlatformAtmosSet1/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set1.js @@ -17,7 +17,8 @@ $(document).ready(function() { dpInput.prop('disabled', true); dpInput.wrap('
'); $("").insertAfter(dpInput); - $("

").insertAfter(".confirm-delivery-date"); + let doNotShow = $(".do-not-show").length ? " class='do-not-show'" : ""; + $("

").insertAfter(".confirm-delivery-date"); fp.config.onChange.push(function() { manipulateDateInputValue(); }); @@ -37,7 +38,11 @@ $(document).ready(function() { }); /* Set first selectable day selected */ - setDateSelected(); + + spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val(); + if (spawnDateInputValue === '') { + setDateSelected(); + } changeDelivery(fp); } @@ -93,24 +98,16 @@ function manipulateDateInputValue() { function setDateSelected() { let spwnFirstSelectableDay = $(".flatpickr-day:not(.flatpickr-disabled)").first().text(); let spwnFPdate = new Date(); - let spwnDay = spwnFPdate.getDate(); let spwnMonth = spwnFPdate.getMonth(); - let spwnMonthTemp = 0; + // month +1 (january == 0) spwnMonth = spwnMonth + 1; - if((String(spwnMonth)).length === 1) { - spwnMonthTemp = spwnMonth; - spwnMonth = '0' + spwnMonth; - } 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; - - fp.setDate(new Date(spwnFrmattedDate)); + fp.setDate(new Date(spwnFrmattedDate), true); spawnDateInputValue = spwnFirstSelectableDay + '.' + spwnMonth + '.' + spwnFPdate.getFullYear(); } @@ -153,8 +150,8 @@ function changeDelivery(fp) { if (spawnDateInputValue === "" || spawnDateInputValue.indexOf("Uhr") === -1) { manipulateDateInputValue(); } - // If DPD date is not in Abendzustellung range } else { + // If DPD date is not in Abendzustellung range setDateSelected(); } } else { diff --git a/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/component/_card.scss b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/component/_card.scss index 489dc6f..8d46aa8 100644 --- a/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/component/_card.scss +++ b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/component/_card.scss @@ -86,11 +86,20 @@ border-radius: 3px; background: rgba(#86B04B, 0.15); color: #86B04B; + &.spwn-c-p-more { + background-color: #33548c; + color: #fff; + } .icon { min-width: 22px; align-self: auto; color: #86B04B; } + &.spwn-c-p-more { + .icon { + color: #fff; + } + } } .cart-item { &.is-discountable-item { diff --git a/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/overrides.scss b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/overrides.scss index de194a1..30b8031 100644 --- a/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/overrides.scss +++ b/zenitPlatformAtmosSet1/src/Resources/app/storefront/src/scss/overrides.scss @@ -179,6 +179,6 @@ input.custom-number[type=number] { } .confirm-delivery-date.do-not-show, -#spwn-delivery { +#spwn-delivery.do-not-show { display: none !important; } diff --git a/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig b/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig index edc10f2..f69c610 100644 --- a/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig +++ b/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig @@ -4,7 +4,8 @@ {% set listPrice = price.listPrice %}

- {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} + {{ price.unitPrice|currency }} +{# {{ "general.star"|trans|sw_sanitize }}#}

{% set weekProductCount = 0 %} @@ -43,4 +44,21 @@ {% endblock %} {% endblock %} {% endif %} +{% endblock %} + +{% block buy_widget_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 %} + + ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) +{# {{ "general.star"|trans|sw_sanitize }}#} + + {% endblock %} + {% endif %} +
{% endblock %} \ No newline at end of file diff --git a/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/checkout/offcanvas-cart.html.twig b/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/checkout/offcanvas-cart.html.twig index b445232..550ed3b 100644 --- a/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/checkout/offcanvas-cart.html.twig +++ b/zenitPlatformAtmosSet1/src/Resources/views/storefront/component/checkout/offcanvas-cart.html.twig @@ -17,14 +17,16 @@ {% endfor %}
{# spawntree start #} - {% if customizedProductsCount == 1 || customizedProductsCount == 2 %} -
+ {% if customizedProductsCount == 1 || customizedProductsCount == 2 || customizedProductsCount > 3 %} +
{% sw_icon 'checkmark-circle' %}
{% if customizedProductsCount == 1 %} {{ "checkout.diaekoProgramNoticeFirst"|trans|sw_sanitize }} {% elseif customizedProductsCount == 2 %} {{ "checkout.diaekoProgramNoticeSecond"|trans|sw_sanitize }} + {% elseif customizedProductsCount > 3 %} + {{ "checkout.diaekoProgramNoticeMore"|trans|sw_sanitize }} {% endif %}
diff --git a/zenitPlatformAtmosSet1/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig b/zenitPlatformAtmosSet1/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig index ab33f95..c55caa7 100644 --- a/zenitPlatformAtmosSet1/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig +++ b/zenitPlatformAtmosSet1/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig @@ -4,7 +4,8 @@ {% set listPrice = price.listPrice %}

- {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} + {{ price.unitPrice|currency }} +{# {{ "general.star"|trans|sw_sanitize }}#}

{% if listPrice.percentage > 0 %} @@ -32,4 +33,22 @@ {% endblock %} {% endblock %} {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} + + +{% block page_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 %} + + ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) +{# {{ "general.star"|trans|sw_sanitize }}#} + + {% endblock %} + {% endif %} +
+{% endblock %} diff --git a/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js b/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js index ed506f1..1c4d0e5 100644 --- a/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js +++ b/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js @@ -17,7 +17,8 @@ $(document).ready(function() { dpInput.prop('disabled', true); dpInput.wrap('
'); $("").insertAfter(dpInput); - $("

").insertAfter(".confirm-delivery-date"); + let doNotShow = $(".do-not-show").length ? " class='do-not-show'" : ""; + $("

").insertAfter(".confirm-delivery-date"); fp.config.onChange.push(function() { manipulateDateInputValue(); }); @@ -37,7 +38,11 @@ $(document).ready(function() { }); /* Set first selectable day selected */ - setDateSelected(); + + spawnDateInputValue = $(".confirm-delivery-date #dtgs-datepicker-inputfield").val(); + if (spawnDateInputValue === '') { + setDateSelected(); + } changeDelivery(fp); } @@ -93,24 +98,16 @@ function manipulateDateInputValue() { function setDateSelected() { let spwnFirstSelectableDay = $(".flatpickr-day:not(.flatpickr-disabled)").first().text(); let spwnFPdate = new Date(); - let spwnDay = spwnFPdate.getDate(); let spwnMonth = spwnFPdate.getMonth(); - let spwnMonthTemp = 0; + // month +1 (january == 0) spwnMonth = spwnMonth + 1; - if((String(spwnMonth)).length === 1) { - spwnMonthTemp = spwnMonth; - spwnMonth = '0' + spwnMonth; - } 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; - - fp.setDate(new Date(spwnFrmattedDate)); + fp.setDate(new Date(spwnFrmattedDate), true); spawnDateInputValue = spwnFirstSelectableDay + '.' + spwnMonth + '.' + spwnFPdate.getFullYear(); } @@ -153,8 +150,8 @@ function changeDelivery(fp) { if (spawnDateInputValue === "" || spawnDateInputValue.indexOf("Uhr") === -1) { manipulateDateInputValue(); } - // If DPD date is not in Abendzustellung range } else { + // If DPD date is not in Abendzustellung range setDateSelected(); } } else { diff --git a/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/component/_card.scss b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/component/_card.scss index 5a7c699..57da07c 100644 --- a/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/component/_card.scss +++ b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/component/_card.scss @@ -92,11 +92,20 @@ border-radius: 3px; background: rgba(#86B04B, 0.15); color: #86B04B; + &.spwn-c-p-more { + background-color: #86b04b; + color: #272527; + } .icon { min-width: 22px; align-self: auto; color: #86B04B; } + &.spwn-c-p-more { + .icon { + color: #272527; + } + } } .cart-item { &.is-discountable-item { diff --git a/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/overrides.scss b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/overrides.scss index c10aa18..9751288 100644 --- a/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/overrides.scss +++ b/zenitPlatformAtmosSet2/src/Resources/app/storefront/src/scss/overrides.scss @@ -167,6 +167,6 @@ input.custom-number[type=number] { } .confirm-delivery-date.do-not-show, -#spwn-delivery { +#spwn-delivery.do-not-show { display: none !important; } diff --git a/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig b/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig index edc10f2..f69c610 100644 --- a/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig +++ b/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/buy-widget/buy-widget-price.html.twig @@ -4,7 +4,8 @@ {% set listPrice = price.listPrice %}

- {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} + {{ price.unitPrice|currency }} +{# {{ "general.star"|trans|sw_sanitize }}#}

{% set weekProductCount = 0 %} @@ -43,4 +44,21 @@ {% endblock %} {% endblock %} {% endif %} +{% endblock %} + +{% block buy_widget_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 %} + + ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) +{# {{ "general.star"|trans|sw_sanitize }}#} + + {% endblock %} + {% endif %} +
{% endblock %} \ No newline at end of file diff --git a/zenitPlatformAtmosSet2/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig b/zenitPlatformAtmosSet2/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig index ab33f95..4650b18 100644 --- a/zenitPlatformAtmosSet2/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig +++ b/zenitPlatformAtmosSet2/src/Resources/views/storefront/page/product-detail/buy-widget-price.html.twig @@ -4,7 +4,8 @@ {% set listPrice = price.listPrice %}

- {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} + {{ price.unitPrice|currency }} +{# {{ "general.star"|trans|sw_sanitize }}#}

{% if listPrice.percentage > 0 %} @@ -32,4 +33,21 @@ {% endblock %} {% endblock %} {% endif %} +{% endblock %} + +{% block page_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 %} + + ({{ price.referencePrice.price|currency }} / {{ price.referencePrice.referenceUnit }} {{ price.referencePrice.unitName }}) +{# {{ "general.star"|trans|sw_sanitize }}#} + + {% endblock %} + {% endif %} +
{% endblock %} \ No newline at end of file