Hide line item properties in cart added by Checkout Blocks

Although most themes including Shopify's default Dawn theme hide line item properties that have a key starting with an underscore '_', (also known as hidden line item properties) some themes, especially custom ones, do not.

Why are these hidden line item properties being added?

Checkout Blocks adds hidden line item properties to products added via upsell blocks in order to provide accurate revenue attribution.

How can I hide these hidden line item properties?

Within your theme code, look for your cart templates/snippets (such as snippets/cart-drawer.liquid within Shopify's Dawn theme) and make sure the line item properties for loop is skipping any line item with a key that starts with an underscore.


You can include the following line within the for loop to skip underscore properties:

{% unless p.last == blank or first_character == '_' %} 

Here's an example within Shopify's Dawn theme's snippets/cart-drawer.liquid:

Code example