remove cart icon from home page

Hi I am trying to figure out how to hide the cart icon from my homepage header but have it still show on the product page header. Is this possible?

1 Like

Hey @painnpill ,

Yes, it’s possible to hide the cart icon from the homepage header but keep it visible on the product page header by applying conditional logic using Liquid and CSS.

Follow these steps:

  1. Online Store > Themes > Edit Code

  2. Open your header.liquid or theme.lioquid file (depending on your theme).

  3. Find the code block responsible for the cart icon. It may look something like:


  

Wrap the cart icon’s code inside a conditional Liquid statement like this:

{% unless template.name == 'index' %}
  
    
  
{% endunless %}

This ensures that the cart icon won’t show on the homepage (index template) but will appear on other pages, including product pages.

  1. Using CSS with Liquid

  2. Add the following code in the theme.liquid or header.liquid:


  

Go to Assets and open your theme’s CSS file (e.g., theme.css or styles.css).

Add this CSS at the bottom:

.hide-cart {
  display: none;
}

Let me know if this works for you!

If I was able to help you, please don’t forget to Like and mark it as the Solution!

Best Regard,

Rajat Sharma

Hey @painnpill

Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.

Best Regards,
Moeed

Hello @painnpill

Yes, it’s possible. Could you please share the store URL and password with me so I can check and provide you with the exact solution?

deadiloveyou.com pass:iloveyou

1 Like

Hey @painnpill

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag

{% if template == 'index' %}

{% endif %}

RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

1 Like

ive looked everywhere for the tag in theme.liquid and can’t find it, do you have a line number it may be on?

1 Like

It should be in the end of the file and just incase if you can’t find then you can also add it below

Best Regards,

Moeed

Hello @painnpill

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. Find Layout > theme.liquid and paste this at the bottom of the file:
{% if template == 'index' %}
    
{% endif %}

worked perfect thank youu

Thank you for your reply. I’m glad to hear that the solution worked well for you. If you require any more help, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.