Browse articles

Adapt functionality based on customer tags or other conditions

Hide EliteCart, upsells, addons, the banner or the reward bar for some visitors, with a setting or a few lines of theme code.

Last updated

You can adapt EliteCart's functionality based on customer tags or other conditions, for example turn the cart off for wholesale customers or hide the banner for logged-in shoppers. Many of these cases now have a setting. For the rest, a few lines of Liquid in your theme do it.

First check if a setting does it

You want toUsePlan
Turn EliteCart off for logged-in customers with a tagDeactivate drawer for logged in customer with tag at Cart designerOtherAdvancedAll plans
Show a reward only for some customers (product or collection in cart, customer tag, UTM, logged in, B2B)The Conditions section of each reward at Cart designerFeaturesRewardsProfessional
Show an upsell flow only for some customers (customer tags, UTM, B2B)Advanced trigger conditions in the flow at UpsellsProfessional
Show rewards, addons or the banner only at certain timesSchedule, see Schedule rewards, addons and bannersProfessional
Show the banner, addons or rewards only in some marketsThe market settings of each feature, for example Market-specific announcement banners
Other settings card with wholesale entered in Deactivate drawer for logged in customer with tag.

Use code for everything else

Set window.eliteCartOverwrites in your theme and EliteCart reads it. Liquid lets you decide per visitor: by customer tag, login, page, locale, country or anything else Liquid knows.

KeyEffect
disableCartEliteCart doesn't load at all. Your theme's cart shows instead, and EliteCart doesn't track cart views or adds for this visitor
hideUpsellsHides the upsells
hideAddonsHides the addons
hideBannerHides the announcement banner
hideRewardBarHides the reward bar
hideReward1, hideReward2, hideReward3Hide one reward. Legacy reward bar (Rewards V1) only

Set only the keys you need, each to true:

<script>
  window.eliteCartOverwrites = {
    hideUpsells: true,
    hideBanner: true
  };
</script>

Where to put the code

Add it to your theme's theme.liquid file, inside <head>, so it's set before EliteCart loads. disableCart only works if it's set before EliteCart loads. The other keys are read whenever the cart renders.

If you set the reward overrides later with a script, ask the reward bar to recalculate:

window.dispatchEvent(new CustomEvent("eliteCart:reinitializeRewardBar"));

Example: hide EliteCart for wholesale customers

This turns EliteCart off for logged-in customers tagged wholesale, whatever the upper or lower case:

{% assign isWholesaleCustomer = false %}
{% for tag in customer.tags %}
  {% assign lowerTag = tag | downcase %}
  {% if lowerTag == "wholesale" %}
    {% assign isWholesaleCustomer = true %}
  {% endif %}
{% endfor %}

{% if isWholesaleCustomer %}
  <script>
    window.eliteCartOverwrites = { disableCart: true };
  </script>
{% endif %}

For a single tag with exact spelling, the Deactivate drawer for logged in customer with tag setting does the same without code.

Example: hide the banner for logged-in customers

Useful when your banner says "Log in to get free shipping":

{% if customer %}
  <script>
    window.eliteCartOverwrites = { hideBanner: true };
  </script>
{% endif %}

Still stuck?

Chat with us and we'll help you get your cart live. Or email contact@elitecart.app.