Conditionally Hide Giftship Options Based on Your Carts Contents
In order to hide Giftship Options (multiple shipping address toggle, gift messages, datepicker, etc.) conditionally on your site based on the contents of your cart, 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.
Here is an example that shows how to hide the multiple shipping address toggle if a subscription item is in the cart. The below checks for the presence of a “item.variant.requires_selling_plan” line item property. If this is present, we do not want to show the multiple shipping address toggle.
{% assign show_multi_address = 'true' %}
{% for item in cart.items %}
{% if item.variant.requires_selling_plan == true %}
{% assign show_multi_address = 'false' %}
{% endif %}
{% endfor %}
{% if show_multi_address == "false" %}
<style>
#gs__toggle-box {
display: none !important;
}
</style>
{% endif %}
Here is an example that shows how to only show both the multiple shipping address toggle and gift message feature if a product tagged with ‘gift’ is present in the cart.
{% assign show_giftship = 'true' %}
{% for item in cart.items %}
{% if item.product.tags contains 'gift' %}
{% assign show_giftship = 'true' %}
{% endif %}
{% endfor %}
{% if show_giftship == "false" %}
<style>
#gs__toggle-box {
display: none !important;
}
#gsAppContainer {
display: none !important;
}
</style>
{% endif %}
Here is an example that shows how to only show the multiple shipping address toggle if a product type is equal to a certain type.
{% assign show_multi_address = 'true' %}
{% for item in cart.items %}
{% unless item.product.type == "Gourmet Gift Boxes" or item.product.type == "Other Hampers" %}
{% assign show_multi_address = 'false' %}
{% endunless %}
{% endfor %}
{% if show_multi_address == "false" %}
<style>
#gs__toggle-box {
display: none !important;
}
</style>
{% endif %}
Can't find the answer in our documentation?
Contact Support Retrieve B2B Saved Addresses in Multiship
Drawer Cart: Automatically Clear Datepicker After X Hours
Automatically Add Upsell (e.g. Insurance) in Drawer Cart
Disable Multiship Call to Action in Drawer Cart for Certain Product Types
How to Add Product Bundles Manually to Cart
Google Font Real-Time Personalizer
Remove Blocks Based on Country
Remove British Forces from Multi-Address Modal
How to Add Custom Scripts to Multiship
Conditionally Showing Datepicker Blocks Based on Product Types in Cart Using the Hidden Input Block
Showing Product Option Blocks Based on Customer Tags with the Hidden Input Block
Event API Example: Automatically Add an Ice Pack to Each Shipment in the Multiple shipping Address Process
Drawer Cart CSS Styling Options
Preventing Checkout Until Giftship Bundles are Loaded
Javascript Event API
Showing Product Option Blocks Based on Product Variants with the Hidden Input Block
Edit Gift Messages etc on Multiship and Cart Page in Giftship
Adding Bundles when a User Navigates to the Cart Page
How to show bundle price on product page as bundle is built
Conditionally Hide Giftship Options Based on Your Carts Contents
Giftship Checkout API ⚒️