How to Display a Gift Message on Your Cart Page When it was Added on Your Product Page 🏷️

If you collect gift messages with Giftship on your product page, and you would like to show this message to your customers on the cart page, you can do so by ensuring that line item properties are displaying in your theme.

While many themes have this enabled by default, others do not, and must be added in manually.

The steps to add line item properties into your theme differ on a theme by theme basis, however, the same general concepts apply to all themes.

Please note that a backup should be made to your theme prior to making any edits. Basic HTML and Liquid code knowledge is required to complete this tutorial.

  1. Navigate to Shopify Admin -> Online Store -> Themes -> “Your theme name” -> Actions -> Edit Code.
  2. Find the loop which iterates through your cart contents. This is often found in the cart.liquid file in your templates folder, or the the cart-template.liquid file in your sections folder.
  3. Somewhere within the loop, add the following snippet of code.
  4. Click save. 😀
  {% assign property_size = item.properties | size %}
  {% if property_size > 0 %}
    {% for p in item.properties %}
      {% assign first_character_in_key = p.first | truncate: 1, '' %}
      {% unless p.last == blank or first_character_in_key == '_' %}
        {{ p.first }}:
        {% if p.last contains '/uploads/' %}
          <a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
        {% else %}
          {{ p.last }}
        {% endif %}
        <br>
      {% endunless %}
     {% endfor %}
  {% endif %}                  

Can't find the answer in our documentation?
Contact Support