How to Hide Bundle Sub-Items in Emails and Documents?

Created by Baz ‎‎, Modified on Fri, 6 Dec, 2024 at 8:32 AM by Diztech BV.

Email Template Update

  1. Ensure that the option "Use a custom line item type instead of the default 'Product' line item type" is enabled in the plugin configuration.

  2. Replace the existing email template code with the following updated code:

{% if nestedItem.children.count > 0 %}
    {% set nestingLevel = nestingLevel + 1 %}
    {% for lineItem in nestedItem.children %}
        {% set nestedItem = lineItem %}
        {{ block('lineItem') }}
    {% endfor %}
{% endif %}

You need to replace the above code with the code below:

{% set hidebundleProductPriceinInvoice = config('ZeobvBundleProducts.config.hideBundleChildlineItemsOnOrderConfirmationMail') %}
{% if nestedItem.children.count > 0 %}
    {% set nestingLevel = nestingLevel + 1 %}
    {% for lineItem in nestedItem.children %}
        {% set nestedItem = lineItem %}
        {% if nestedItem.type === 'bundle_product_item' %}
            {% if hidebundleProductPriceinInvoice == '1' %}
            {% else %}
                {{ block('lineItem') }}
            {% endif %}
        {% else %}
            {{ block('lineItem') }}
        {% endif %}
    {% endfor %}
{% endif %}


Steps to Test

  1. Confirm Plugin Configuration: Ensure the following plugin options are enabled:

    • "Hide bundle sub-items on order confirmation email."

    • "Hide bundle sub-items on invoices and delivery documents."

    • "Use a custom line item type instead of the default 'Product' line item type."

  2. Order Confirmation Email:

    • Place a test order for a bundled product.

    • Verify that sub-items are hidden in the order confirmation email.

  3. Invoices and Delivery Documents:

    • Generate an invoice or delivery document for the test order.

    • Confirm that sub-items are hidden as per the configuration.

  4. Theme Compatibility: Test with both standard Shopware themes and custom themes to ensure consistent functionality.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article