Hello,
I’m trying to hide the “Continue Shopping” button when the cart is empty. Is there any way to do this using the Dawn theme?
Alternatively, I’d like to hide the cart icon when empty, is this possible?
Thanks.
Hello,
I’m trying to hide the “Continue Shopping” button when the cart is empty. Is there any way to do this using the Dawn theme?
Alternatively, I’d like to hide the cart icon when empty, is this possible?
Thanks.
Hello @thrette ,
To hide checkout button when cart is empty, add this css in base.css at bottom.
You can find this file under assets
.cart__warnings .button {
display: none;
}
To hide cart icon you have to wrap existing code with if condition e.g.
{%- if cart.item_count > 0 -%} your existing code {% endif %}
Thanks
Thanks @Guleria , your code works to hide the “continue shopping” button when the cart is empty.
I tried adding the following code before the tag in the theme.liquid file to hide the cart when empty with no luck:
{%- if cart.item_count > 0 -%}
[details=Show More]
.header__icon, .header__icon–cart .icon {
display: none !important;
}
{% endif %}
Any suggestions?
{%- if cart.item_count < 0 -%}
{% endif %}
@Guleria still no luck but thanks for your reply. I’m using the Dawn theme if that helps
First check what you get in this {{ cart.item_count }} variable and ten write the logic.
@Guleria I’m familar with HTML and CSS but new to Liquid. How do I get the logic?