### Composer Installation der Erweiterung netinextbundles Source: https://shopware6.io.netinventors.de/plugins/NetiNextBundles/de/installation Installiert die Erweiterung über Composer aus dem Shopware Store. Voraussetzung ist ein angemeldeter Shopware Account und ein installiertes und aktiviertes Shopware Store Plugin. ```bash composer require store.shopware.com/netinextbundles ``` -------------------------------- ### Twig-Code für Bestellbestätigungs-E-Mail: Bundle-Formularfelder anzeigen Source: https://shopware6.io.netinventors.de/plugins/NetiNextBundles/de/configuration/form-fields-configuration.html Fügen Sie diesen Twig-Code in das HTML-Template der Bestellbestätigungs-E-Mail ein, idealerweise direkt unter der Artikeltabelle (nach dem schließenden `{% endfor %}` der Positionen bzw. nach ``). Er ermittelt die Mail-Sprache, prüft, ob Bundle-Formularfelder vorhanden sind, und gibt diese gruppiert nach Bundle-Bestandteilen aus. Leere Felder werden mit '- nicht ausgefüllt -' angezeigt, Textarea-Werte mit `nl2br` formatiert. ```twig {# Sprache sicher ermitteln #} {% set mailLocale = locale ?? order.language.translationCode.code ?? 'de-DE' %} {% set hasBundleFields = false %} {% for lineItem in order.lineItems %} {% if lineItem.payload.netiBundleFormFields is defined and lineItem.payload.netiBundleFormFields|length > 0 %} {% set hasBundleFields = true %} {% endif %} {% endfor %} {% if true === hasBundleFields %}
Deine Bundle-Konfigurationen:

{% for rootItem in order.lineItems %} {% if rootItem.payload.netiBundleFormFields is defined and rootItem.payload.netiBundleFormFields|length > 0 %} {% for setItemId, formFields in rootItem.payload.netiBundleFormFields %} {# Kind-Item zur Namensfindung suchen #} {% set childItem = null %} {% for item in order.lineItems %} {% if null === childItem and item.parentId is same as(rootItem.id) and item.payload['neti-bundle-set-item-id'] is defined and item.payload['neti-bundle-set-item-id'] is same as(setItemId) %} {% set childItem = item %} {% endif %} {% endfor %}
{% if null !== childItem %}{{ childItem.label }}{% else %}{{ rootItem.label }}{% endif %}
{% for techName, field in formFields %} {% set fallbackLabel = field.labels|first|default(techName) %} {% set label = field.labels[mailLocale] ?? fallbackLabel %}
{{ label }}: {% if null === field.value or '' === field.value %} - nicht ausgefüllt - {% else %} {{ 'textarea' === field.type ? field.value|nl2br : field.value }} {% endif %}
{% endfor %}
{% endfor %} {% endif %} {% endfor %}
{% endif %} ``` -------------------------------- ### Plain Template: Preise ausblenden - nachher Source: https://shopware6.io.netinventors.de/plugins/NetiNextBundles/de/configuration/email-configuration.html Angepasster Code, der die Preise nur anzeigt, wenn die Option 'neti-bundle-hide-price' nicht gesetzt ist. Wichtig: ohne Zeilenumbruch einfügen und nach dem {% endif %} umbrechen. ```twig {% if lineItem.payload is defined and lineItem.payload["neti-bundle-hide-price"] is defined and lineItem.payload["neti-bundle-hide-price"] is same as(true) %}{% else %}{{ lineItem.unitPrice|currency(currencyIsoCode) }} {{ lineItem.totalPrice|currency(currencyIsoCode) }}{% endif %} ``` -------------------------------- ### Plain-Text Template for Bundle Configuration Fields Source: https://shopware6.io.netinventors.de/plugins/NetiNextBundles/de/configuration/form-fields-configuration.html Twig template for plain-text emails that renders bundle configuration fields from order line items. It determines the mail locale, checks for bundle form fields, and outputs each field label and value, marking empty fields as '- nicht ausgefüllt -'. Use this in the Plain-Text area of the email template. ```twig {# Sprache sicher ermitteln #} {% set mailLocale = locale ?? order.language.translationCode.code ?? 'de-DE' %} {% set hasBundleFields = false %} {% for lineItem in order.lineItems %} {% if lineItem.payload.netiBundleFormFields is defined and lineItem.payload.netiBundleFormFields|length > 0 %} {% set hasBundleFields = true %} {% endif %} {% endfor %} {% if true === hasBundleFields %} --- Bundle-Konfigurationen --- {% for rootItem in order.lineItems %} {% if rootItem.payload.netiBundleFormFields is defined and rootItem.payload.netiBundleFormFields|length > 0 %} {% for setItemId, formFields in rootItem.payload.netiBundleFormFields %} {% set childItem = null %} {% for item in order.lineItems %} {% if null === childItem and item.parentId is same as(rootItem.id) and item.payload['neti-bundle-set-item-id'] is defined and item.payload['neti-bundle-set-item-id'] is same as(setItemId) %} {% set childItem = item %} {% endif %} {% endfor %} Position: {% if null !== childItem %}{{ childItem.label }}{% else %}{{ rootItem.label }}{% endif %} {% for techName, field in formFields %} {% set fallbackLabel = field.labels|first|default(techName) %} {% set label = field.labels[mailLocale] ?? fallbackLabel %} > {{ label }}: {% if null === field.value or '' === field.value %}- nicht ausgefüllt -{% else %}{{ field.value|replace({"\n": ", "}) }}{% endif %} {% endfor %} {% endfor %} {% endif %} {% endfor %} {% endif %} ``` -------------------------------- ### HTML Template: Preise ausblenden - nachher Source: https://shopware6.io.netinventors.de/plugins/NetiNextBundles/de/configuration/email-configuration.html Angepasster Code, der die Preise nur anzeigt, wenn die Option 'neti-bundle-hide-price' nicht gesetzt ist. Verwendet eine Variable 'hideBundleItemPrice'. ```twig {% set hideBundleItemPrice = lineItem.payload is defined and lineItem.payload["neti-bundle-hide-price"] is defined and lineItem.payload["neti-bundle-hide-price"] is same as(true) %} {% if hideBundleItemPrice %}{% else %}{{ nestedItem.unitPrice|currency(currencyIsoCode) }}{% endif %} {% if hideBundleItemPrice %}{% else %}{{ nestedItem.totalPrice|currency(currencyIsoCode) }}{% endif %} ``` -------------------------------- ### HTML Template: Preise ausblenden - vorher Source: https://shopware6.io.netinventors.de/plugins/NetiNextBundles/de/configuration/email-configuration.html Originalcode im HTML-Mail-Template, der die Preise in Tabellenzellen anzeigt. ```twig {{ nestedItem.unitPrice|currency(currencyIsoCode) }} {{ nestedItem.totalPrice|currency(currencyIsoCode) }} ``` -------------------------------- ### Plain Template: Preise ausblenden - vorher Source: https://shopware6.io.netinventors.de/plugins/NetiNextBundles/de/configuration/email-configuration.html Originalcode im Plain-Mail-Template, der die Preise anzeigt. Muss ersetzt werden, um Preise auszublenden. ```twig {{ lineItem.unitPrice|currency(currencyIsoCode) }} {{ lineItem.totalPrice|currency(currencyIsoCode) }} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.