How to Hide Cart Item Properties

This guide explains how to hide cart line item properties in your Shopify store when running a shipping experiment.

Why Do Cart Line Item Properties Appear?

Normally, Shopify will automatically hide cart properties that start with an underscore (_). However, some custom themes or apps may not respect this, which can lead to visible properties in carts, order pages, or checkout views. If that’s the case for your store, you have a few options to hide them.

Ways to Hide Cart Item Properties

Depending on whether you’re currently running a shipping experiment or just want to clean up your cart display, here are different methods you can use to remove cart item properties from customer-facing views.

Hiding Properties on your cart page or cart drawer

You can customize the display of cart properties by modifying your theme’s Liquid code. Here’s how to do it:

  1. In your Shopify admin, go to Online Store > Themes.

  2. Next to your live theme, click the Actions dropdown and select Edit Code.

  3. Find the relevant file for your cart (this might be named cart.liquid or cart-drawer.liquid, depending on your theme).

  4. Look for the section that loops through line item properties, which may look like this:

{%- for property in item.properties -%}
  1. To prevent certain properties from displaying, add a condition that skips any property starting with an underscore:

{%- for property in item.properties -%}
  {%- unless property.first == '_' -%}
    <!-- Content Displayed -->
  {%- endunless -%}
{%- endfor -%}
  1. Save the changes. This will hide the experiment-related data from appearing on the cart page, while keeping it active for backend tracking.

For Email Notifications and Packing Slips

If you're seeing cart item properties in emails sent to customers (like order confirmations) or in packing slips, you can follow a similar process to hide them:

  1. Go to Settings in Shopify, then select Notifications.

  2. Choose the notification type you want to edit, such as Order Confirmation.

  3. Click Edit Code and look for the part that displays line item properties.

  4. Add the same condition to skip properties that start with an underscore.

  5. Save your changes to prevent the properties from showing in your emails.

For packing slips, follow a similar process:

  1. Go to Settings > Shipping and Delivery.

  2. Scroll down to Packing Slips and click Edit Template.

  3. Add the conditional logic as in the cart example to prevent the display of unwanted properties.

Managing Cart Properties in Third-Party Apps

Some third-party apps, such as upsell tools or cart customizers, might also display cart item properties. Many of these apps offer settings that allow you to hide properties based on certain conditions (like starting with an underscore).

For example, if you're using a cart upsell app, navigate to its settings and look for an advanced option to hide these cart properties. If you can’t find this option, check the app’s documentation or contact their support team for help.

Notes on Shopify’s Order Page

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 your experiments accurately. However, customers won’t see this information—it’s only visible to you and your team.

Getting Help

If you encounter challenges or need expert guidance on hiding the cart line item properties, we're here to assist:

  • Live Chat Support: For immediate help, use the live chat widget located at the bottom right corner of the Elevate A/B Testing app interface.

  • Email Support: Our dedicated team is here to support you, you can email us at support@elevateab.com

Last updated