How to display "Part of: " bundle text in Packing Slip and Order notifications
When handling orders in Shopify, it's crucial that customers and staff members can easily see which items in their orders are part of a bundle. However, in some templates, the text indicating which part of the bundle an item belongs to is not displayed on packing slips or order notifications, such as the order confirmation email. To resolve this, we need to use the groups
object of the line items. Below, we provide guidance on how to ensure this text is displayed properly in your Shopify templates.
It's important to note that this is directly related to Cart Transform API. This may also not work with other popular third-party apps in printing invoices or packing slips, such as the Order Printer Pro by Forsberg.
Prerequisites
Before proceeding, ensure that you have enabled Simple Bundles 2.0 version enabled, which utilizes Shopify's CartTransform function.
Using the Groups Object
To display the bundle information, you'll need to loop through the groups
object associated with each line item. Here's a snippet of code that you can use as a reference.
{% for group in line_item.groups %} Part of: {{ group.title }} {% endfor %}
Note: This code should be placed inside the loop that iterates over your line items. The variable names used in the loop will depend on the specific template you are editing.
Placing the Code on Different Templates
Let's look at where to place this code in different templates:
1. Shopify Packing Slip Template
In the Shopify Packing Slip, you would typically find a loop that looks something like this:
{% for line_item in line_items_in_shipment %} <!-- Your existing code for line items --> {% endfor %}
Within this loop, you can add the provided code snippet to ensure the bundle information is displayed:
2. Order Confirmation Email Template
For the order confirmation email template, the loop might look slightly different:
{% for line in subtotal_line_items %} <!-- Your existing code for line items --> {% endfor %}
Within this loop, you can add the provided code snippet to ensure the bundle information is displayed:
Example: Order Confirmation Email
Here's an example of how it might look in the context of an order confirmation email:
Recent Updates in Shopify's Order Printer
In a recent update, Shopify introduced a new version of its order printer for printing invoices and packing slips. The provided code can still be used with this new version to display which part of the bundle an item belongs to.
Example Snippet for New Order Printer:
Output:
If you have any questions or need further assistance with setting this up, please feel free to contact our team. We are happy to help!