custom/plugins/Theme3S/src/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.     {% set articlerestocktime = product.restockTime %}
  8.     {% if product.restockTime > 84 %}
  9.         {% set articlerestocktime = 84 %}
  10.     {% endif %}
  11.     <div class="product-delivery-information">
  12.         <div class="{{ product.availableStock }}" id="LOOK HERE"> </div>
  13.         {% if product.shippingFree %}
  14.             {% block component_delivery_information_shipping_free %}
  15.                 <p class="delivery-information delivery-shipping-free">
  16.                     <span class="delivery-status-indicator bg-info"></span>
  17.                     {{ "general.deliveryShippingFree"|trans|sw_sanitize }}
  18.                 </p>
  19.             {% endblock %}
  20.         {% endif %}
  21.         {% if not product.active %}
  22.             {% block component_delivery_information_not_available %}
  23.                 <link itemprop="availability"
  24.                       href="http://schema.org/LimitedAvailability"/>
  25.                 <p class="delivery-information delivery-not-available">
  26.                     <span class="delivery-status-indicator bg-danger"></span>
  27.                     {{ "general.deliveryNotAvailable"|trans|sw_sanitize }}
  28.                 </p>
  29.             {% endblock %}
  30.         {% elseif product.releaseDate and product.releaseDate|date('U') > "now"|date('U') %}
  31.             {% block component_delivery_information_pre_order %}
  32.                 <link itemprop="availability"
  33.                       href="http://schema.org/PreOrder"/>
  34.                 <p class="delivery-information delivery-preorder">
  35.                     <span class="delivery-status-indicator bg-warning"></span>
  36.                     {{ "general.deliveryShipping"|trans|sw_sanitize }} {{ product.releaseDate|format_date('long', locale=app.request.locale) }}
  37.                 </p>
  38.             {% endblock %}
  39.         {% elseif (product.availableStock >= product.minPurchase or (downloadFlag in product.states and not product.isCloseout)) and product.deliveryTime %}
  40.             {% block component_delivery_information_available %}
  41.                 <link itemprop="availability" href="http://schema.org/InStock"/>
  42.                 <p class="delivery-information delivery-available">
  43.                     <span class="delivery-status-indicator bg-success"></span>
  44.                     {{ "detail.deliveryTimeAvailable"|trans({
  45.                         '%name%': product.deliveryTime.translation('name')
  46.                     })|sw_sanitize }}
  47.                 </p>
  48.             {% endblock %}
  49.         {% elseif product.isCloseout and product.availableStock < product.minPurchase %}
  50.             {% block component_delivery_information_soldout %}
  51.                 <link itemprop="availability" href="http://schema.org/OutOfStock"/>
  52.                 <p class="delivery-information delivery-soldout">
  53.                     <span class="delivery-status-indicator bg-danger"></span>
  54.                     {{ "detail.soldOut"|trans|sw_sanitize }}
  55.                 </p>
  56.             {% endblock %}
  57.         {% elseif product.availableStock < product.minPurchase and product.deliveryTime and product.restockTime %}
  58.             {% block component_delivery_information_restock %}
  59.                 <link itemprop="availability" href="http://schema.org/LimitedAvailability"/>
  60.                 <p class="delivery-information delivery-restock">
  61.                     <span class="delivery-status-indicator bg-warning"></span>
  62.                     {{ "detail.deliveryTimeRestock"|trans({
  63.                         '%count%': articlerestocktime,
  64.                         '%restockTime%': articlerestocktime,
  65.                         '%name%': product.deliveryTime.translation('name')
  66.                     })|sw_sanitize }}
  67.                 </p>
  68.             {% endblock %}
  69.         {% else %}
  70.             {% block component_delivery_information_default %}{% endblock %}
  71.         {% endif %}
  72.     </div>
  73.     <div id="deliverinfo_container"></div>
  74. {% endblock %}