Hiding bundle items from Order Printer Pro receipts and packing slips
This article applies to Simple Bundles 1.0. If you're using Simple Bundles 2.0, refer to How to show itemized bundle contents using Order Printer Pro packing slips.
In Simple Bundles 1.0, bundle items are added to orders as 100% discounted line items. Use the code snippets below to hide those items from your Order Printer Pro packing slips and receipts, and to remove the bundle discount from the pricing summary.
To group bundle items under their bundle instead of hiding them, use the template in How to show itemized bundle contents using Order Printer Pro packing slips. That template works on Simple Bundles 1.0 and 2.0.
How do I hide bundle items from Order Printer Pro packing slips?
- In Order Printer Pro, go to the Manage templates page.
- Click Edit template next to the template you want to change.
- Scroll to where the line item for loop begins, or search the template for:
for line_item in line_items
- Directly below that line, paste the snippet below. You can also copy it from this GitHub Gist.
- Click Save.
Your packing slip now leaves out the 100% discounted bundle items.
What if I have other 100% discounted items?
The snippet in step 4 hides every 100% discounted item, including free items that aren't part of a bundle. To hide only bundle items, skip step 4 and use these snippets instead. They check for the Simple Bundles: discount title that the app adds to bundle items.
- Add this line right before the {% for line_item in line_items %} loop:
{% assign discount_application_titles = discount_applications | map: 'title' %}
- Add this snippet right after the {% for line_item in line_items %} line:
{% assign line_item_is_bundle_item = false %}
{% assign bundle_item_total = 0 %}
{% for discount_allocation in line_item.discount_allocations %}
{% if discount_application_titles[discount_allocation.discount_application_index] contains "Simple Bundles: " %}
{% assign line_item_is_bundle_item = true %}
{% assign total_line_price = line_item.original_price | times: line_item.quantity %}
{% assign bundle_item_total = bundle_item_total | plus: total_line_price %}
{% continue %}
{% endif %}
{% endfor %}
{% if line_item_is_bundle_item %}
{% continue %}
{% endif %}
How do I remove the bundle discount from the pricing summary?
Some Order Printer Pro packing slip and invoice templates show the discount reason and total when calculating the subtotal. To remove the Simple Bundles discount from that section:
- Go to the pricing section of the template. This is everything after class="pricing" in the template file.
- Select everything inside the if total_discounts != 0.0 block shown above.
- Replace the selected code with the code below. You can also copy it from this GitHub Gist.
After you replace it, the template code looks like this:
- Click Save. Bundle discounts no longer appear in the subtotal calculation.
Other, non-bundle discounts on the order still show right before the subtotal:
If you have questions about Order Printer Pro templates, contact our team over chat or email.
Related articles
How to show itemized bundle contents using Order Printer Pro packing slips
Hiding bundles from Shopify packing slips
Merging line item quantities with the same SKU on packing slips