{% sw_extends '@Storefront/storefront/component/delivery-information.html.twig' %} {# ---------------- START: SET TEMPLATE VARS ---------------- #} {# ThemeWare: Set theme variables #} {% set twtProductDetailStockLabelShow = theme_config('twt-product-detail-stock-label-show') %} {% set twtProductDetailStockLabelThresholdLowstock = theme_config('twt-product-detail-stock-label-threshold-lowstock') %} {% set twtProductDetailStockLabelThresholdHighstock = theme_config('twt-product-detail-stock-label-threshold-highstock') %} {% set twtCustomAnnouncementShow = theme_config('twt-custom-announcement-show') %} {% set twtProductDetailSoldLabelShow = theme_config('twt-product-detail-sold-label-show') %} {# ---------------- END: SET TEMPLATE VARS ---------------- #} {# ThemeWare: Add our stock/sold-labels above the delivery information #} {% block component_delivery_information %} {# @var product \Shopware\Core\Content\Product\ProductEntity #} {% if page is defined and page.product is defined %} {% set product = page.product %} {% endif %} {# ThemeWare: Add "Stock label" #} {# TODO: > availableStock via configuration... waiting for multi-select fix - stock-label as include - Check availability: if product.availableStock >= product.minPurchase and product.deliveryTime #} {% if twtProductDetailStockLabelShow == 2 %} {% block twt_delivery_information_stock_label %} {% if product.availableStock > 0 and product.availableStock <= twtProductDetailStockLabelThresholdLowstock %} {# ThemeWare: "Nur noch ... lieferbar." #}
{{ "twt.detail.stockLabel.lowStock.label"|trans({'%stock%': product.availableStock })|sw_sanitize }}
{% elseif product.availableStock > twtProductDetailStockLabelThresholdLowstock and product.availableStock <= twtProductDetailStockLabelThresholdHighstock %} {# ThemeWare: "Auf Lager." bzw. ".. auf Lager." #} {#% if "instock" in theme_config('twt-product-detail-stock-label-options') %}{{ "twt.detail.stockLabel.inStock"|trans }}
{% endif %#} {% elseif product.availableStock > twtProductDetailStockLabelThresholdHighstock %} {# ThemeWare: "Über ... lieferbar." #}{{ "twt.detail.stockLabel.highStock.label"|trans({'%stock%': twtProductDetailStockLabelThresholdHighstock })|sw_sanitize }}
{% endif %} {% endblock %} {% endif %} {# TODO: if product.shippingFree >> Versandkostenfrei #} {# TODO: if not product.active >> Diese Auswahl steht nicht zur Verfügung elseif product.releaseDate and product.releaseDate|date('U') > "now"|date('U') >> Dieses Produkt erscheint am elseif product.availableStock >= product.minPurchase and product.deliveryTime >> Sofort verfügbar, Lieferzeit %name% #} {# OK: elseif product.isCloseout and product.availableStock < product.minPurchase >> Nicht mehr verfügbar #} {# TODO: elseif product.availableStock < product.minPurchase and product.deliveryTime and product.restockTime >> {1} Versandfertig in 1 Tag, Lieferzeit %name% |]1,Inf[ Versandfertig in %restockTime% Tagen, Lieferzeit %name% #} {# ThemeWare: Add "Sold out label" #} {% if twtProductDetailSoldLabelShow == 2 %} {% block twt_delivery_information_soldout_label %} {% if product.isCloseout and product.availableStock < product.minPurchase %} {# ThemeWare: "Derzeit nicht auf Lager." #}{{ "twt.detail.stockLabel.noStock"|trans }}
{% endif %} {% endblock %} {% endif %} {# Default delivery information #} {{ parent() }} {# ThemeWare: Custom-Announcement #} {% if twtCustomAnnouncementShow == 2 or twtCustomAnnouncementShow == 3 %} {% sw_include '@Storefront/storefront/themeware/twt-custom-announcement.html.twig' ignore missing with { type: 'detail', } %} {% endif %} {% endblock %} {# ThemeWare: Hide Shopware "Delivery information: Shipping free" #} {% block component_delivery_information_shipping_free %} {# TODO: hide shipping-free hint when badge is added #} {{ parent() }} {% endblock %} {# ThemeWare: Hide Shopware "Delivery information: soldout" #} {% block component_delivery_information_soldout %} {% if twtProductDetailSoldLabelShow == 1 %} {{ parent() }} {% endif %} {% endblock %}