Conditionally Hide the Gift Message Option on Product Pages 🏷️

In order to hide the default Gift Message option conditionally on your product pages based on individual products or collections, you can detect the contents in different manners (properties, tags, collections, etc.), and then conditionally load some CSS on your store if certain conditions are met.

Choose how you would like to build in this logic, and then find your product.liquid or product-template.liquid theme file.

Here is an example that shows how to only show the Gift Message option on two specific collections:

{% assign show_giftship = 'true' %}

{% for product in collection.products %}
  {% unless collection.title == "Gourmet Gift Boxes" or collection.title == "Other Hampers" %}
    {% assign show_giftship = 'false' %}
  {% endunless %}
{% endfor %}


{% if show_giftship == "false" %}
  <style>
    #gsAppContainer {
      display: none !important;
    }
  </style>
{% endif %}

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