Hide bundle contents from customer logged-in order history page
If you are using a custom logged-in page for customers where they are able to view their order history and you would like to hide the contents in a bundle added to yours order, follow the steps below:
1. Click on the Online Store in the sidebar
2. Under themes, click on Actions and the Edit code
3. Search for the file with "order" and "customer" keywords which may have the code for the order history page. Every theme is different and the file names may vary depending on your theme.
4. To hide the line items, locate the line items loop: {% for line_item in order.line_items %}
5. Add the following lines after the "for" loop:
{% assign show_line_item = true %}
{% if line_item.line_level_discount_allocations != blank %}
{% for discount_allocation in line_item.line_level_discount_allocations %}
{% if discount_allocation.discount_application.title contains "Profit Bundles:" %}
{% assign show_line_item = false %}
{% endif %}
{% endfor %}
{% endif %}
{% unless show_line_item %}
{% continue %}
{% endunless %}
6. To hide the discount subtotal for each bundle item, locate the following "for" loop: {% for discount_application in order.cart_level_discount_applications %}
7. Add the following lines after the "for" loop to hide the subtotal discount items:
{% if discount_application.title contains "Profit Bundles:" %}
{% continue %}
{% endif %}
Now, both your line items and discount items for your bundle contents should be hidden when your customers log in.