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 item.properties.subscription_id %}
{% assign show_multi_address = 'false' %}
{% endif %}
{% endfor %}
{% if show_multi_address == "false" %}
<style>
/* This hides Giftship's multi-address toggle feature */
#gs__toggle-box {
display: none !important;
}
</style>
{% endif %}
Can't find the answer in our documentation?
Contact Support Tax Calculation for Multi-Address Checkouts in the United States
Conditionally Hide the Multiple Shipping Address Toggle Based on Your Carts Contents
Shopify Plus: Adding Product Images Back to the Multi-Address Checkout
Sending non-physical products to multiple recipients
Troubleshooting multi-address orders not splitting in to child orders
Using Giftship in Multiple Languages
Integration with Wholesale & Volume Discount Applications
Enable Order Notes for Shipping to Multiple Addresses
Fulfilling Multiple Shipping Address Orders
Issuing Refunds for Multiple Shipping Address Orders
Discount Codes for Multi-address orders.
Making Ship to Multiple Address Cart the Default Cart
Viewing Reports with Multiple Shipping Address Orders