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

Open in your IDE?
  1. {# @var product \Shopware\Core\Content\Product\ProductEntity #}
  2. {# @var deliverytime \Shopware\Core\Checkout\Cart\Delivery\Struct\DeliveryTime #}
  3. {% block component_delivery_information %}
  4.     {% if page is defined and page.product is defined %}
  5.         {% set product = page.product %}
  6.     {% endif %}
  7.  
  8.     {#Product cart/Checkout show delivery time.#}
  9.     {%if lineItem is defined and lineItem.deliveryInformation is defined %}
  10.  
  11.         {% set deliverytime = lineItem.deliveryInformation.deliveryTime %}
  12.         {# {% set deliveryTimeId = page.cart.data.elements["product-#{lineItem.id}"].deliveryTimeId %} #}
  13.         {% set deliveryTimeId = page.cart.data.elements["product-#{lineItem.referencedId}"].deliveryTimeId %}
  14.         {% block component_delivery_information_available_ammactrade %}
  15.             <link itemprop="availability" href="http://schema.org/InStock"/>
  16.             {% if(deliveryTimeId == '32c6890dcfe34dae9ef1c16320b3afc2') %}
  17.                 <p class="delivery-information delivery-available">
  18.                     <a href="/kundenservice/lieferzeiten/" target="_blank" style="color: #26c156;">
  19.                         <span class="delivery-status-indicator bg-success"></span>
  20.                         {{ deliverytime.name }} <span style="text-decoration: underline;">(mehr Infos)</span>
  21.                     </a>
  22.                 </p>
  23.             {% else %}
  24.                 <p class="delivery-information delivery-restock">
  25.                     <a href="/kundenservice/lieferzeiten/" target="_blank" style="color: #f89d0e;">
  26.                         <span class="delivery-status-indicator bg-warning"></span>
  27.                         {{ deliverytime.name }} <span style="text-decoration: underline;">(mehr Infos)</span>
  28.                     </a>
  29.                 </p>
  30.             {% endif %}
  31.         {% endblock %}
  32.     {% elseif  lineItem is defined and page.order.deliveries %}
  33.         {#Product final page show delivery time.#}
  34.         {% if lineItem.type == PRODUCT_LINE_ITEM_TYPE %}
  35.             {% set shippingMethodId = null %}
  36.             {% for key, value in page.order.deliveries.elements %}
  37.                     {% if lineItem.orderId == value.orderId %}
  38.                         {% set shippingMethodId = value.shippingMethodId %}
  39.                     {% endif %}
  40.             {% endfor %}
  41.             {% set deliverytime = null %}
  42.             {% for key, value in page.salesChannelShippingMethods.elements %}                    
  43.                     {% if shippingMethodId == value.id %}
  44.                         {% set deliverytime = value.deliveryTime %}
  45.                     {% endif %}
  46.             {% endfor %}
  47.            <p class="delivery-information delivery-available">
  48.             
  49.                 <a href="/kundenservice/lieferzeiten/" target="_blank" style="color: {{ lineItem.payload.deliveryTimeacColor }};">
  50.                 {% if lineItem.payload.deliveryTimeac %}
  51.                                 <span class="delivery-status-indicator {% if lineItem.payload.deliveryTimeacColor == '#ffbd5d' %}bg-warning{%else%}bg-success bg-success-indicator{% endif %}"></span>
  52.                 {{ lineItem.payload.deliveryTimeac }} <span style="text-decoration: underline;">(mehr Infos)</span>
  53.                 {% else %}
  54.                                 <span class="delivery-status-indicator {% if lineItem.payload.deliveryTimeacColor == '#ffbd5d' %}bg-warning{%else%}bg-success bg-success-indicator{% endif %}"></span>
  55.                 {{ deliverytime.name }} <span style="text-decoration: underline;">(mehr Infos)</span>
  56.                 {% endif %}
  57.                 
  58.                 
  59.                 </a>
  60.             </p>  
  61.            {# <p class="delivery-information delivery-available">
  62.                 <a href="/kundenservice/lieferzeiten/" target="_blank" style="color: #26c156;">
  63.                 <span class="delivery-status-indicator bg-success"></span>
  64.                 {{ deliverytime.name }}
  65.                 </a>
  66.             </p> #}
  67.         {% endif %}
  68.     {% else %}
  69.             {#
  70.             1. Wenn Artikel auf Lager dann anzeige auf lager und grün
  71.             2. Alle anderen Werte in orangener Farbe
  72.             3. wenn verfügbarer Bestand negativ, dann Anzeige von "Lieferbar in 1-3 Wochen und orange
  73.             #}
  74.             <div class="{{ product.deliveryTime.translation('name') }}"></div>
  75.             <div class="product-delivery-information">
  76.                 {% if product.shippingFree %}
  77.                     {% block component_delivery_information_shipping_free %}
  78.                         <p class="delivery-information delivery-shipping-free">
  79.                             <a href="/kundenservice/lieferzeiten/" target="_blank" style="">
  80.                                 <span class="delivery-status-indicator bg-info"></span>
  81.                                 {{ "general.deliveryShippingFree"|trans|sw_sanitize }} <span style="text-decoration: underline;">(mehr Infos)</span>
  82.                             </a>
  83.                         </p>
  84.                     {% endblock %}
  85.                 {% endif %}
  86.                 {% if not product.active %}
  87.                     {% block component_delivery_information_not_available %}
  88.                         <link itemprop="availability" href="http://schema.org/LimitedAvailability"/>
  89.                         <p class="delivery-information delivery-not-available">
  90.                             <a href="/kundenservice/lieferzeiten/" target="_blank" style="">
  91.                                 <span class="delivery-status-indicator bg-danger"></span>
  92.                                 {{ "general.deliveryNotAvailable"|trans|sw_sanitize }} <span style="text-decoration: underline;">(mehr Infos)</span>
  93.                             </a>
  94.                         </p>
  95.                     {% endblock %}
  96.                 {% elseif product.releaseDate and product.releaseDate|date('U') > "now"|date('U') %}
  97.                     {% block component_delivery_information_pre_order %}
  98.                         <link itemprop="availability" href="http://schema.org/PreOrder"/>
  99.                         <p class="delivery-information delivery-preorder">
  100.                             <a href="/kundenservice/lieferzeiten/" target="_blank">
  101.                                 <span class="delivery-status-indicator bg-warning"></span>
  102.                                 {{ "general.deliveryShipping"|trans|sw_sanitize }} {{ product.releaseDate|format_date('long', locale=app.request.locale) }} <span style="text-decoration: underline;">(mehr Infos)</span>
  103.                             </a>
  104.                         </p>
  105.                     {% endblock %}
  106.                 {% else  %}
  107.                     {% block component_delivery_information_available %}
  108.                         <link itemprop="availability" href="http://schema.org/InStock"/>
  109.                         {% if(product.deliveryTimeId == '32c6890dcfe34dae9ef1c16320b3afc2') %}
  110.                             <p class="delivery-information delivery-available">
  111.                                 <a href="/kundenservice/lieferzeiten/" target="_blank" style="color: #26c156;">
  112.                                     <span class="delivery-status-indicator bg-success"></span>
  113.                                     {{ product.deliveryTime.translation('name') }} <span style="text-decoration: underline;">(mehr Infos)</span>
  114.                                 </a>
  115.                             </p>
  116.                         {% else %}
  117.                             <p class="delivery-information delivery-restock">
  118.                                 <a href="/kundenservice/lieferzeiten/" target="_blank" style="color: #f89d0e;">
  119.                                     <span class="delivery-status-indicator bg-warning"></span>
  120.                                     {{ product.deliveryTime.translation('name') }} <span style="text-decoration: underline;">(mehr Infos)</span>
  121.                                 </a>
  122.                             </p>
  123.                         {% endif %}
  124.                     {% endblock %}
  125.                 {% endif %}
  126.             </div>
  127.             {#<div class="product-delivery-information">
  128.                 {% if product.shippingFree %}
  129.                     {% block component_delivery_information_shipping_free %}
  130.                         <p class="delivery-information delivery-shipping-free">
  131.                             <span class="delivery-status-indicator bg-info"></span>
  132.                             {{ "general.deliveryShippingFree"|trans|sw_sanitize }}
  133.                         </p>
  134.                     {% endblock %}
  135.                 {% endif %}
  136.                 {% if not product.active %}
  137.                     {% block component_delivery_information_not_available %}
  138.                         <link itemprop="availability"
  139.                               href="http://schema.org/LimitedAvailability"/>
  140.                         <p class="delivery-information delivery-not-available">
  141.                             <span class="delivery-status-indicator bg-danger"></span>
  142.                             {{ "general.deliveryNotAvailable"|trans|sw_sanitize }}
  143.                         </p>
  144.                     {% endblock %}
  145.                 {% elseif product.releaseDate and product.releaseDate|date('U') > "now"|date('U') %}
  146.                     {% block component_delivery_information_pre_order %}
  147.                         <link itemprop="availability"
  148.                               href="http://schema.org/PreOrder"/>
  149.                         <p class="delivery-information delivery-preorder">
  150.                             <span class="delivery-status-indicator bg-warning"></span>
  151.                             {{ "general.deliveryShipping"|trans|sw_sanitize }} {{ product.releaseDate|format_date('long', locale=app.request.locale) }}
  152.                         </p>
  153.                     {% endblock %}
  154.                 {% elseif product.availableStock >= product.minPurchase and product.deliveryTime %}
  155.                     {% block component_delivery_information_available %}
  156.                         <link itemprop="availability" href="http://schema.org/InStock"/>
  157.                         <p class="delivery-information delivery-available">
  158.                             <span class="delivery-status-indicator bg-success"></span>
  159.                             {{ "detail.deliveryTimeAvailable"|trans({
  160.                                 '%name%': product.deliveryTime.translation('name')
  161.                             })|sw_sanitize }}
  162.                         </p>
  163.                     {% endblock %}
  164.                 {% elseif product.isCloseout and product.availableStock < product.minPurchase %}
  165.                     {% block component_delivery_information_soldout %}
  166.                         <link itemprop="availability" href="http://schema.org/LimitedAvailability"/>
  167.                         <p class="delivery-information delivery-soldout">
  168.                             <span class="delivery-status-indicator bg-danger"></span>
  169.                             {{ "detail.soldOut"|trans|sw_sanitize }}
  170.                         </p>
  171.                     {% endblock %}
  172.                 {% elseif product.availableStock < product.minPurchase and product.deliveryTime and product.restockTime %}
  173.                     {% block component_delivery_information_restock %}
  174.                         <link itemprop="availability" href="http://schema.org/LimitedAvailability"/>
  175.                         <p class="delivery-information delivery-restock">
  176.                             <span class="delivery-status-indicator bg-warning"></span>
  177.                             {{ "detail.deliveryTimeRestock"|trans({
  178.                                 '%count%': product.restockTime,
  179.                                 '%restockTime%': product.restockTime,
  180.                                 '%name%': product.deliveryTime.translation('name')
  181.                             })|sw_sanitize }}
  182.                         </p>
  183.                     {% endblock %}
  184.                 {% endif %}
  185.             </div>#}
  186.     {% endif %}
  187. {% endblock %}