vendor/shopware/storefront/Resources/views/storefront/component/delivery-information.html.twig line 1

Open in your IDE?
  1. {% block component_delivery_information %}
  2.     {# @var product \Shopware\Core\Content\Product\ProductEntity #}
  3.     {% if page is defined and page.product is defined %}
  4.         {% set product = page.product %}
  5.     {% endif %}
  6.     <div class="product-delivery-information">
  7.         {% if product.shippingFree %}
  8.             {% block component_delivery_information_shipping_free %}
  9.                 <p class="delivery-information delivery-shipping-free">
  10.                     <span class="delivery-status-indicator bg-info"></span>
  11.                     {{ "general.deliveryShippingFree"|trans|sw_sanitize }}
  12.                 </p>
  13.             {% endblock %}
  14.         {% endif %}
  15.         {% if not product.active %}
  16.             {% block component_delivery_information_not_available %}
  17.                 <link itemprop="availability"
  18.                       href="http://schema.org/LimitedAvailability"/>
  19.                 <p class="delivery-information delivery-not-available">
  20.                     <span class="delivery-status-indicator bg-danger"></span>
  21.                     {{ "general.deliveryNotAvailable"|trans|sw_sanitize }}
  22.                 </p>
  23.             {% endblock %}
  24.         {% elseif product.releaseDate and product.releaseDate|date('U') > "now"|date('U') %}
  25.             {% block component_delivery_information_pre_order %}
  26.                 <link itemprop="availability"
  27.                       href="http://schema.org/PreOrder"/>
  28.                 <p class="delivery-information delivery-preorder">
  29.                     <span class="delivery-status-indicator bg-warning"></span>
  30.                     {{ "general.deliveryShipping"|trans|sw_sanitize }} {{ product.releaseDate|format_date('long', locale=app.request.locale) }}
  31.                 </p>
  32.             {% endblock %}
  33.         {% elseif product.availableStock >= product.minPurchase and product.deliveryTime %}
  34.             {% block component_delivery_information_available %}
  35.                 <link itemprop="availability" href="http://schema.org/InStock"/>
  36.                 <p class="delivery-information delivery-available">
  37.                     <span class="delivery-status-indicator bg-success"></span>
  38.                     {{ "detail.deliveryTimeAvailable"|trans({
  39.                         '%name%': product.deliveryTime.translation('name')
  40.                     })|sw_sanitize }}
  41.                 </p>
  42.             {% endblock %}
  43.         {% elseif product.isCloseout and product.availableStock < product.minPurchase %}
  44.             {% block component_delivery_information_soldout %}
  45.                 <link itemprop="availability" href="http://schema.org/LimitedAvailability"/>
  46.                 <p class="delivery-information delivery-soldout">
  47.                     <span class="delivery-status-indicator bg-danger"></span>
  48.                     {{ "detail.soldOut"|trans|sw_sanitize }}
  49.                 </p>
  50.             {% endblock %}
  51.         {% elseif product.availableStock < product.minPurchase and product.deliveryTime and product.restockTime %}
  52.             {% block component_delivery_information_restock %}
  53.                 <link itemprop="availability" href="http://schema.org/LimitedAvailability"/>
  54.                 <p class="delivery-information delivery-restock">
  55.                     <span class="delivery-status-indicator bg-warning"></span>
  56.                     {{ "detail.deliveryTimeRestock"|trans({
  57.                         '%count%': product.restockTime,
  58.                         '%restockTime%': product.restockTime,
  59.                         '%name%': product.deliveryTime.translation('name')
  60.                     })|sw_sanitize }}
  61.                 </p>
  62.             {% endblock %}
  63.         {% else %}
  64.             {% block component_delivery_information_default %}{% endblock %}
  65.         {% endif %}
  66.     </div>
  67. {% endblock %}