🕷️How to hide hidden properties on your cart?

Shopify offers the functionality to append data to products in your shopping cart through the feature known as line item properties. Cowlendar taps into this capability to add timeslot/dates picked by your customer to their orders.

When theme are coded in a wrong way, you will see that in the cart (which you should not see, as it is called hidden properties)

Properties of line items that start with the underscore symbol "_" are considered to be "hidden". Consequently, Shopify does not display these properties when you're on the /checkout page or within the invoices.

Although many Shopify themes recognize and hide these properties in the online storefront, not every theme does. To address this, you can incorporate a specific condition within the line item property loop found in the cart.liquid file (or other potential filenames mentioned later).

Step 1 : search for your cart.liquid file. Alternate names could be cart-template.liquid, framework--cart.liquid, cart-drawer.liquid, main-cart-items.liquid, or mini-cart.liquid. A pro tip: if you can't find these filenames, simply search for 'cart' within your theme's files

Step 2 : search for "item.properties" in the cart.liquid file

Step 3 : narrow it down until you find {% for p in item.properties %}

Keep in mind, this code might slightly differ based on your theme. For instance, it might be: {% for prop in item.properties %} or it could also be something like {% for property in item.properties %}

Step 4 : Immediately after finding it, insert:

{% if p.first.first == "_" %}{% continue %}{% endif %}

or {% if prop.first.first == "_" %}{% continue %}{% endif %} or {% if property.first.first == "_" %}{% continue %}{% endif %}

Step 5 : hidden properties should now be hidden good job

A few things to note:

  • As i've said earlier, the variable name in the code can vary. Instead of using 'p', it might use 'property' or 'prop'. In such cases, make sure you adjust the 'p' in the code to match the appropriate variable name. If you dont know what to do, just contact me on the live chat <3

Last updated