Please note that some of the changes recommended in this guide involve making direct changes to the theme code. If you encounter difficulties with this, please contact a third-party developer for more troubleshooting, customization, or functionality.
While Shopify is the go-to place to host your e-commerce business, some people don't want or need the shopping cart feature. In this guide, we'll walk through removing those features in a temporary way so you can enable them again down the line if you need to.
To remove the cart icon in the header
From your Shopify admin, go to Online Store > Themes, click the ... icon next to your theme, and select Edit code.
You’ll be looking for the header-icons.liquid file in your snippets folder.
Now search for href="/cart" and you'll come across a block of code that starts with this:
<a href="/cart" class="site-nav__link site-nav__link--icon js-drawer-open-cart js-no-transition" aria-controls="CartDrawer">
Add a class of hide so your code now looks like this:
<a href="/cart" class="hide site-nav__link site-nav__link--icon js-drawer-open-cart js-no-transition" aria-controls="CartDrawer">
In other theme versions, you may need to search for href="{{ routes.cart_url }}". The code looks like this:
<a href="{{ routes.cart_url }}" class="site-nav__link site-nav__link--icon js-drawer-open-cart" aria-controls="CartDrawer" data-icon="{{ settings.cart_icon }}">Add a class of hide so the code is updated to:
<a href="{{ routes.cart_url }}" class="hide site-nav__link site-nav__link--icon js-drawer-open-cart" aria-controls="CartDrawer" data-icon="{{ settings.cart_icon }}">The hide class prevents the button from showing. Remove it later to bring that feature back.
To remove the 'add to cart' button
- From your Shopify admin, go to Online Store > Themes and click Edit theme to open the theme editor.
- Open the product page.
- In the left sidebar, locate the Buy buttons block under Product.
- Hover over the block and click the eye icon to hide the add to cart button.
That's it, your cart features have been disabled.