How to bring back hidden add to cart button on my homepage in Crave Theme

How to bring back hidden add to cart button on my homepage in Crave Theme

sugarstarhq
Visitor
1 0 0

Hi, last year I ask for help from a developer in the Shopify Community to hide 'add to cart' button from my homepage. Then, now I want to make it appear again but I forgot where to find the code section and which code that the developer put it. I hope someone can help me or guide me to solve the issue. I'm using 'crave' theme. 

 

Thank you very much.

 

This is the website - sugarstar.com.my

Reply 1 (1)

BrainStation23
Shopify Partner
406 60 58

Hi @sugarstarhq. You can try the following code in your header.liquid file. As we don't have access to the code of your header.liquid file, we can't check it. For your information, the following code is taken from Crave theme.

 

{%- if shop.customer_accounts_enabled -%}
<a href="{{ routes.cart_url }}" class="header__icon header__icon--cart link focus-inset" id="cart-icon-bubble">
        {%- liquid
          if cart == empty
            render 'icon-cart-empty'
          else
            render 'icon-cart'
          endif
        -%}
        <span class="visually-hidden">{{ 'templates.cart.cart' | t }}</span>
        {%- if cart != empty -%}
          <div class="cart-count-bubble">
            {%- if cart.item_count < 100 -%}
              <span aria-hidden="true">{{ cart.item_count }}</span>
            {%- endif -%}
            <span class="visually-hidden">{{ 'sections.header.cart_count' | t: count: cart.item_count }}</span>
          </div>
        {%- endif -%}
      </a>
{% endif %}

 

Feel free to ask any question if you have any.

Brain Station 23 PLC (Mail: [email protected])
- Was your question answered? Mark it as an Accepted Solution
- Did the solution not address your concern? We kindly request that share or mail your store URL with us this will enable us to collaborate more closely.
- Explore our Shopify public apps