Overview
Shopify line item properties let apps and merchants attach custom data to cart items, but the underscore prefix convention that hides them at checkout doesn't always work in theme cart templates or email notifications. This FAQ answers the most common questions about how the underscore prefix behaves across cart, checkout, order admin, email templates, and packing slips. Whether you use a bundle app like Biscuits Bundles, a subscription app, or custom product options, this guide will help you understand the convention and fix any leaks.
Contents
The Basics: Line Item Properties and the Underscore Convention
What are Shopify line item properties?
A line item is a line in a cart, checkout, or order, and each line item represents a product variant. Line item properties are custom key-value pairs attached to that line item. Line item properties allow an additional layer of customization over basic product data. They can be utilized to gather extra information from customers at the point of purchase, such as personalizations, notes, or product-specific instructions.
For example, a custom engraving field, a gift message, or internal tracking data from a Shopify app can all be stored as line item properties. If two of the same item are added to the cart, but have unique line item properties, then they'll be split into separate line items. This is important to understand because bundle apps, subscription apps, and custom options apps all rely on properties to track selections.
What does the underscore prefix do on a line item property?
You can add an underscore to the beginning of a property name to hide it from customers at checkout. For instance, a property named _bundleId uses this convention. Line item properties which begin with an underscore "_" are classified as hidden properties, and Shopify will not show them on the /checkout page or on invoices.
The underscore only affects the display of the line item property. They are still being pushed to Shopify and will appear in the order detail page. So the data is never deleted; it simply isn't rendered to the customer in certain contexts.
What is the difference between a single underscore and a double underscore prefix?
Shopify actually has two levels of "hiding." To make a line item property private, prepend an underscore (_) to the key. Private line item properties are available in the Liquid line_item.properties object and Ajax API. To hide private properties on the storefront, you must modify the theme's codebase.
The double underscore (__) prefix works differently and applies to cart attributes, not line item properties. You can add a double underscore __ prefix to an attribute name to make it private. Private attributes behave like other cart attributes, except that they can't be read from Liquid or the Ajax API. You can use them for data that doesn't affect the page rendering, which allows for more effective page caching.
Cart and Checkout Behavior
Why do underscore-prefixed properties still show in my cart drawer or cart page?
Line item properties which begin with an underscore "_" are classified as hidden properties, and Shopify will not show them on the /checkout page or on invoices. Most themes also respect this and hide them from the online store, but this is not supported by every theme. Shopify's checkout rendering handles the hiding automatically, but your theme's Liquid templates control what shows in the cart page and cart drawer.
Line item properties that start with an underscore _ for example: "_bundleId" are system line item properties and should be hidden from your customers on cart drawer, cart page and checkout. Shopify manages the hiding on checkout automatically, but it is up to your theme (and theme developers) to hide system properties in your cart drawer and cart page. If you see properties like _bundleId, _ssub_interval, or _Gifted in your cart, your theme simply lacks the filter logic.
Which types of apps commonly use underscore-prefixed properties?
Many categories of Shopify apps attach hidden line item properties to track internal data. Bundle apps like Biscuits Bundles use them to store bundle identifiers and step selections. Some themes might not automatically hide subscription properties which start with underscore. You can know this if you subscribe to an item, go to cart and see properties like _ssub_interval: 30 day or _ssub_ruleid: 424. Gift apps, A/B testing tools, and custom product option apps also rely on this convention.
The common pattern is the same: the app stores internal tracking data using underscore-prefixed properties that should be invisible to the shopper. When your theme doesn't filter them out, it creates a confusing experience.
Fixing Your Theme: The Liquid Code Edit
How do I hide underscore-prefixed properties in my cart template?
To fix this, all we need to do is add a condition to the line item property loop in your cart.liquid template (it could also be in another file). Within your cart.liquid (or other cart file) template, find the line that loops through properties. It typically looks like one of these patterns:
{% for p in item.properties %} or {%- for property in item.properties -%}
In between the line loop for property in item.properties we need to output a variable to calculate what the first character of the property is. {%- assign property_first_char = property.first | slice: 0 -%} Now we can add to the if statement already being used. Change {%- if property.last != blank -%} into {%- if property.last != blank and property_first_char != '_' -%}
Tip - Always duplicate your theme before editing code. First, create a development theme so any changes you make don't appear on your live store until you have tested and are happy with them. Open Online Store > Themes in Shopify admin and click the three dot menu next to customise on your published theme, then choose "duplicate".
Which theme files should I check for the cart property loop?
Some themes use different file names for the cart template. Instead of cart.liquid it could be called something like: cart-template.liquid, cart-drawer.liquid, cart-item.liquid, main-cart-items.liquid or mini-cart.liquid. For Shopify's Dawn theme, the relevant file is typically main-cart-items.liquid inside the sections folder.
Common names for the cart template include cart.liquid, cart-template.liquid, main-cart-items.liquid and several others. If unsure, use your theme's search function and look for 'cart' or 'item' to find the relevant file. Remember to check both your cart page template and your cart drawer snippet, as they are often separate files.
What if the code snippet doesn't work with my theme?
Check if your theme uses a different variable name than p for properties within the loop. If so, replace p with the correct variable name (e.g., property or prop) in the provided snippet. Some themes use p, others use prop, and others use property as the loop variable. Match whatever your theme already uses.
If you're using Biscuits Bundles and need help, this guide involves editing theme code. If that is not your cup of tea, feel free to reach out to the Biscuits Bundle team to help you out! Your theme developer should also be able to help you make this change as it should be covered by 'general support' and 'bug fixes'. You can also see a working example on the Biscuits Bundles demos page.
Emails, Packing Slips, and Order Admin
Do Shopify's default email templates hide underscore-prefixed properties?
The default email templates in Shopify will hide line item properties of products. However, if your template is customized, you may see properties displayed in the emails. So if you've never touched your notification templates, you should be fine. But if you or a developer has customized your order confirmation, shipping confirmation, or other notification emails, underscore properties might leak through.
To fix this, if you're seeing cart item properties in emails sent to customers (like order confirmations), go to Settings in Shopify, then select Notifications. Choose the notification type you want to edit. Click Edit Code and look for the part that displays line item properties. Add the same condition to skip properties that start with an underscore. Save your changes to prevent the properties from showing in your emails.
What about packing slips?
The line_items_in_shipment variable displays an array of line items that are included in the shipment. Shopify's packing slip template can be edited at Settings > Shipping and delivery > Packing slip template. Click "Shipping and delivery" in the side menu. Scroll down on this page until you find the option "Packing slips" and click "Edit template". Add the condition in the template to skip those properties in your template. The same underscore-check logic applies here.
Side note - Shopify themes have a built-in convention where line-item properties prefixed with an underscore are hidden from the customer. Unfortunately, while these will be hidden on Shopify, they will be displayed on packing slips in some third-party fulfillment tools like ShipStation, which import all line item properties without filtering. If you use external fulfillment software, check whether it respects the underscore convention.
Can I hide underscore properties from the Shopify admin order detail page?
As Shopify's order page cannot be edited, please note that line item properties on the order page cannot be hidden. This is by design. All line item properties, including those with underscore prefixes, are always visible on the admin order detail page. The underscore convention only affects customer-facing surfaces.
While you can hide cart item properties from the customer-facing parts of your store, it's important to note that these properties will still appear in your Shopify admin under individual order details. This is necessary for tracking and processing. However, customers won't see this information; it's only visible to you and your team. This is actually useful because it lets your fulfillment team see internal data like bundle IDs and subscription intervals when processing orders.