I’m wondering what code is needed to hide cart icon before customer is logged in?
I’m using Trade theme.
It’s a B2B site.
Thanks in advance!
I’m wondering what code is needed to hide cart icon before customer is logged in?
I’m using Trade theme.
It’s a B2B site.
Thanks in advance!
Then find the theme.liquid file.
Then add the following code at the end of the file and press ‘Save’ to save it.
Paste the below code before on theme.liquid
{% unless customer %}
{% endunless %}
If it doesn’t work, please share your store link for me to check
Please press ‘Like’ and mark it as ‘Solution’ if you find it helpful. Thank you.
Hi @Solly_1
You can do that by following these steps
{% if customer %}
{%- liquid
if cart == empty
render 'icon-cart-empty'
else
render 'icon-cart'
endif
-%}
{{ 'templates.cart.cart' | t }}
{%- if cart != empty -%}
{%- if cart.item_count < 100 -%}
{{ cart.item_count }}
{%- endif -%}
{{ 'sections.header.cart_count' | t: count: cart.item_count }}
{%- endif -%}
{% endif %}