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

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