Hiding line item attributes

Updated on December 9, 2020

Alpaca uses line item attributes to store information for pickup and delivery scheduling on the theme. Themes are supposed to automatically hide any line item attributes that start with an underscore, however, sometimes this isn’t the case. Here’s how to hide _alpaca_id from appearing on your theme.

Note: you will need to edit code to make this change.

  • Navigate to the Online Store section of the Shopify admin. On your live theme, select Actions and then Edit code.
  • Find the file that displays line item properties. It’s typically in cart.liquid or cart-template.liquid. You’re looking for the following line of code: {% for p in %} or {% for p in properties %}.
  • Inside the for loop, paste the following code at the beginning of the for loop:

{% assign stringToCheck = p.first %}
{% assign startsWith = '_' %}
{% assign checkArray = stringToCheck | split:startsWith %}
{% if checkArray[0] != blank %}

[replace this line]

{% endif %}
  • Now, copy the snippet of code that was originally inside the for loop. Remove the line of code that says [replace this line] and paste in the code you just copied.
  • Done! If you made a mistake, you can always revert to a previous version of the file by clicking the Older versions link next to the file name.

More support articles

Still need help?

Send us an email and we'll get back to you as soon as we can.

Free 7-day trial

Try it for free