Display Conditions: Showing Giftship’s Options Only on Certain Products or Collections 🎛️

Depending on your needs, you can show or hide Giftship’s features based on conditions you define. This can be accomplished in a few ways.

Jump to content:

Add Display Conditions Using Giftship’s Product Options Feature

With Giftship’s Product Options tool, individual feature configurations can be set up to display only on certain products or collections.

Using the Display Options tool within Product Options, this can all be set up within the app. Please see this video for a quick walkthrough.

Conditionally Display Giftship’s Standard Inputs

If you need to manually ‘hide’ options, this can be quite easily accomplished with a small snippet of Liquid and CSS in your theme. For example, if you have the product type of all of your gifts set to “Gift Product”, you can add the following to your theme.liquid file right before the closing </body> tag:

{% if template contains 'product' %}

{% comment %} 
Change 'Gift Product' below to the product type of your Gift products
{% endcomment %}

{% if product.type != 'Gift Product' %}

<style>
/* This hides all of Giftships options on the product page, but you can refine this to hide only certain parts */
#gsAppContainer {
    display: none !important;
}
</style>

<script type="text/javascript">

/* IMPORTANT : This is necessary if you have any options set to required in Giftship, otherwise, customers will not be able to add products to the cart! This removes all of Giftships options, but you can refine this to remove only certain options */

 var GsLoaded = function() {
 
     var _removeBox = function(){

         setTimeout(function(){

             var giftship_box = document.getElementById('gsAppContainer'); 

             if(typeof(giftship_box) != 'undefined' && giftship_box != null){
                giftship_box.parentNode.removeChild(giftship_box);
             } else {
                 _removeBox();
             }
         }, 100);
     }
 
     _removeBox();
 
 }
 
</script>

{% endif %}

{% endif %}

Hide features on your cart page based on cart contents

If you would like to hide certain features on your cart page, based on the contents of your cart, similar concepts to the above apply, which are outlined in the following tutorials:

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