How do I change the shopping bag to a shopping cart in the Dawn theme?

I think it’s ironic that most people asking for help here on this subject want the shopping bag! But I don’t. Is there a way to change the bag to a cart? And – if it is not too difficult – can the icon indicate that something is in the cart when people add to it? (I know I could do a simple html swap - not sure about something complex).

Hi @skaras ,

Please follow the steps:

Ex: file name is ‘icon-cart.svg’

Code:

<img src="{{ 'icon-cart.svg' | asset_url }}" class="icon icon-cart" alt=""/>

Hope it helps!

1 Like

Thank you. Is there a second place to upload a filled cart icon that shows when a person adds something to the cart?

Hi @skaras ,

If you want to show 2 icons like Dawn, you need to upload 1 more icon. Then just change the code:

{%- liquid
          if cart == empty
            render 'icon-cart-empty'
          else
            render 'icon-cart'
          endif
        -%}

=>

{%- if cart == empty -%}
          
        {%- else -%}
          
        {%- endif -%}

And you need to change the same thing at sections/cart-icon-bubble.liquid file.

Hope it helps!

If it helped you solve your issue, please mark it as a solution. Thank you and good luck.

1 Like

Thank you! I will try this out later tonight and see if I can make it work.

Hi @skaras ,

If it helped you solve your issue, please mark it as a solution. Thank you and good luck.

Thanks! I’ll try it out and see.

1 Like

I followed these steps and was able to get both icons, but when I first add a product to the cart, it changes to the bag and then once I enter the shopping cart, the icon changes to the uploaded .svg file I added. Is there code that I need to change for when a custom initially adds items?

No items added:

shimlee_0-1719329858982.png

Item added:

Followed “view cart” button into cart view. Icon correct:

Website: Your Shopping Cart – Shimlee (shopifypreview.com)

Live View Passcode: Khome200