custom/plugins/BettenABC/src/Resources/views/storefront/component/delivery-information.html.twig line 1

Open in your IDE?
  1. {#
  2. # Project:      www.betten-abc.de
  3. # Company:      arboro GmbH
  4. # Created by:   Daniel Geike
  5. # Created on:   22.08.22
  6. # Description:
  7. #}
  8. {% sw_extends "@Storefront/storefront/component/delivery-information.html.twig" %}
  9. {% block component_delivery_information_soldout %}
  10.     {{ block("component_delivery_information_default") }}
  11. {% endblock %}
  12. {% block component_delivery_information_restock %}
  13.     {{ block("component_delivery_information_default") }}
  14. {% endblock %}
  15. {% block component_delivery_information_default %}
  16.     {# controls the default status for "Availability" microdata #}
  17.     {# string will be appended to "http://schema.org/" #}
  18.     {% set availabilityStatus = "InStock" %}
  19.     {# initially set status to available #}
  20.     {# controls the color of text and icon #}
  21.     {% set status = "success" %}
  22.     {% if page.product %}
  23.         {% set product = page.product %}
  24.     {% endif %}
  25.     {% set shippingTimes = {
  26.         "252": "general.defaultDeliveryTime"|trans,
  27.         "323": "general.defaultDeliveryTime"|trans,
  28.         "400": "general.dispatchDeliveryTime"|trans,
  29.         "500": "general.extraServiceDeliveryTime"|trans
  30.     } %}
  31.     {% if product.stock <= 0 %}
  32.         {% set availabilityStatus = "LimitedAvailability" %}
  33.         {% set status = "danger" %}
  34.         {% set shippingTime = "general.restockDeliveryTime"|trans({
  35.             "%count%": product.restockTime,
  36.             "%days%": product.restockTime
  37.         }) %}
  38.     {% elseif product.translated.customFields.custom_product_1 %}
  39.         {% set shippingTime = shippingTimes[product.translated.customFields.custom_product_1|number_format] %}
  40.     {% else %}
  41.         {% set shippingTime = "general.defaultDeliveryTime"|trans %}
  42.     {% endif %}
  43.     {% block component_delivery_information_default_availability %}
  44.         <link itemprop="availability" href="http://schema.org/{{ availabilityStatus }}"/>
  45.     {% endblock %}
  46.     {% block component_delivery_information_default_icon %}
  47.         <span class="delivery-status-indicator bg-{{ status }}"></span>
  48.     {% endblock %}
  49.     {% block component_delivery_information_default_text %}
  50.         {% set FURNPLAN_CONTAINER_LINE_ITEM_TYPE = constant('ArboroFurnplan\\Core\\Checkout\\Furnplan\\LineItemFactoryHandler\\FurnplanContainerLineItemFactory::TYPE') %}
  51.         {% if lineItem.type == FURNPLAN_CONTAINER_LINE_ITEM_TYPE %}
  52.             {{ block("component_delivery_information_default_text_furnplan", "@ArboroFurnplan/storefront/component/delivery-information.html.twig") }}
  53.         {% else %}
  54.             {% if status is same as("success") %}
  55.                 {{ "detail.deliveryTimeAvailable"|trans({
  56.                     '%name%': shippingTime
  57.                 })|sw_sanitize }}
  58.             {% else %}
  59.                 {{ "detail.deliveryTimeNotAvailable"|trans({
  60.                     '%deliveryTime%': shippingTime
  61.                 })|sw_sanitize }}
  62.             {% endif %}
  63.         {% endif %}
  64.     {% endblock %}
  65. {% endblock %}