Conditionally Hide the Multiple Shipping Address Toggle Based on Your Carts Contents

In order to hide the multi-address toggle conditionally on your site based on the contents of your cart, you can detect the contents, and conditionally load some CSS on your store if certain conditions are met.

The below example shows how to hide the toggle if a “Recharge” subscription item is in the cart.

{% assign show_multi_address = 'true' %}

{% for item in cart.items %}

{% comment %}
Here is where we check for the conditions of the products in your cart. The below checks for the presence of a "subscription_id" line item property. If this is present, we do not want to show Giftship.
{% endcomment %}

{% if %}

{% assign show_multi_address = 'false' %}

{% endif %}

{% endfor %}

{% if show_multi_address == "false" %}

/* This hides Giftship's multi-address toggle feature */
#gs__toggle-box {
display: none !important;
{% endif %}

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