How do I remove the shopping cart?
While Shopify is the go-to place to host your ecommerce 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.
First, open up your theme editor and the Edit code option.
To remove the cart icon in the header
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">
The hide class prevents the button from showing. Remove it later to bring that feature back.
To remove the 'Add to cart' button
You likely won't want the add to cart button on the product page either, so open product-form.liquid in your snippets folder and search for add-to-cart. You'll see this chunk of code:
<button
{% if product.empty? %}type="button"{% else %}type="submit"{% endif %}
name="add"
id="AddToCart-{{ section_id }}"
class="btn btn--full add-to-cart{% if enable_dynamic_buttons %} btn--secondary{% endif %}"
{% unless current_variant.available %} disabled="disabled"{% endunless %}>
Similar to the cart icon, you can remove this button by adding the hide class like this:
<button
{% if product.empty? %}type="button"{% else %}type="submit"{% endif %}
name="add"
id="AddToCart-{{ section_id }}"
class="hide btn btn--full add-to-cart{% if enable_dynamic_buttons %} btn--secondary{% endif %}"
{% unless current_variant.available %} disabled="disabled"{% endunless %}>
That's it, your cart features have been disabled.