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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/delivery-information.html.twig' %}
  2. {% block component_delivery_information %}
  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.                 {{ parent() }}
  11.             {% endblock %}
  12.         {% endif %}
  13.         {% if not product.active %}
  14.             {% block component_delivery_information_not_available %}
  15.                 {{ parent() }}
  16.             {% endblock %}
  17.         {% elseif product.releaseDate %}
  18.             {% block component_delivery_information_pre_order %}
  19.                 {% set today = "now"|date('U') %}
  20.                 {% set isPreorderProduct = product.extensions.preorderData ? true : false %}
  21.                 {% set preorderDeadlineReached = product.customFields.custom_preorder_deadline|date('U') < today %}
  22.                 {% set minimalOrderAmountReached = product.customFields.custom_preorder_sales_1 > 0 and product.customFields.custom_preorder_sales_1 <= product.extensions.preorderData.totalOrderAmount %}
  23.                 {% set releaseDateReached = product.releaseDate|date('U') < today %}
  24.                 {% set startProductionDateReached = product.customFields.custom_preorder_start_production| date('U') < today %}
  25.                 {% if not releaseDateReached %}
  26.                     <link itemprop="availability"
  27.                           href="http://schema.org/PreOrder"/>
  28.                     <div class="delivery-information delivery-preorder d-flex">
  29.                         <div>
  30.                             <span class="delivery-status-indicator bg-warning"></span>
  31.                         </div>
  32.                         <div class="flex-grow-1">
  33.                             {{ "general.deliveryShipping"|trans|sw_sanitize }} {{ product.releaseDate|format_date('long', locale=app.request.locale) }}
  34.                             {% if product.customFields.custom_preorder_deadline and isPreorderProduct %}
  35.                                 <br>{{ "wabs-product-preorder.productPage.deadline"|trans }} {{ product.customFields.custom_preorder_deadline|format_date('long', locale=app.request.locale) }}
  36.                             {% endif %}
  37.                         </div>
  38.                     </div>
  39.                 {% endif %}
  40.                 {% if isPreorderProduct %}
  41.                     <div class="preorder-phase-info">
  42.                         {% if not preorderDeadlineReached %}
  43.                             {% if startProductionDateReached %}
  44.                                 {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with
  45.                                     { type: "info",icon: "false", content: 'wabs-product-preorder.phase.production'|trans  } %}
  46.                             {% else %}
  47.                                 {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with
  48.                                     { type: "warning",icon: "false", content: 'wabs-product-preorder.phase.order'|trans  } %}
  49.                             {% endif %}
  50.                         {% endif %}
  51.                         {% if minimalOrderAmountReached %}
  52.                             {% if preorderDeadlineReached %}
  53.                                 {% if  product.extensions.preorderData.hasWareneingang or releaseDateReached %}
  54.                                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with
  55.                                         { type: "success",icon: "false", content: 'wabs-product-preorder.phase.delivery'|trans  } %}
  56.                                 {% else %}
  57.                                     {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with
  58.                                         { type: "info",icon: "false", content: 'wabs-product-preorder.phase.production'|trans  } %}
  59.                                 {% endif %}
  60.                             {% elseif startProductionDateReached %}
  61.                                 {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with
  62.                                     { type: "info",icon: "false", content: 'wabs-product-preorder.phase.production'|trans  } %}
  63.                             {% endif %}
  64.                         {% endif %}
  65.                         {% if preorderDeadlineReached and not minimalOrderAmountReached %}
  66.                             {% sw_include '@Storefront/storefront/utilities/alert.html.twig' with
  67.                                 { type: "danger",icon: "false", content: 'wabs-product-preorder.phase.failed'|trans  } %}
  68.                         {% endif %}
  69.                     </div>
  70.                     {% if not releaseDateReached %}
  71.                         {% if product.customFields.custom_preorder_info %}
  72.                             <div class="product-detail-preorder-product-infobox-container">
  73.                                 <div class="product-detail-preorder-infobox">
  74.                                     <div>
  75.                                         {{ product.customFields.custom_preorder_info|raw }}
  76.                                     </div>
  77.                                 </div>
  78.                             </div>
  79.                         {% endif %}
  80.                         {% if product.extensions.preorderData.totalOrderAmount is not null %}
  81.                             <div class="preorder-current-status">
  82.                                 {{ "wabs-product-preorder.productPage.currentStatus"|trans }} {{ product.extensions.preorderData.totalOrderAmount }}
  83.                             </div>
  84.                         {% endif %}
  85.                     {% endif %}
  86.                 {% endif %}
  87.             {% endblock %}
  88.         {% elseif product.availableStock >= product.minPurchase and product.deliveryTime %}
  89.             {% block component_delivery_information_available %}
  90.                 {{ parent() }}
  91.             {% endblock %}
  92.         {% elseif product.isCloseout and product.availableStock < product.minPurchase %}
  93.             {% block component_delivery_information_soldout %}
  94.                 {{ parent() }}
  95.             {% endblock %}
  96.         {% elseif product.availableStock < product.minPurchase and product.deliveryTime and product.restockTime %}
  97.             {% block component_delivery_information_restock %}
  98.                 {{ parent() }}
  99.             {% endblock %}
  100.         {% else %}
  101.             {% block component_delivery_information_default %}{% endblock %}
  102.         {% endif %}
  103.     </div>
  104. {% endblock %}