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:
- Step 1: Please upload the icon at Assets. https://i.imgur.com/auuqgn3.png
Ex: file name is ‘icon-cart.svg’
- Step 2: Go to sections/header.liquid file, find ‘icon-cart-empty’ and change code: https://i.imgur.com/nXLZ2yA.png => https://i.imgur.com/z6oqVzB.png
Code:
<img src="{{ 'icon-cart.svg' | asset_url }}" class="icon icon-cart" alt=""/>
Hope it helps!
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.
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.
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:
Item added:
Followed “view cart” button into cart view. Icon correct:
Website: Your Shopping Cart – Shimlee (shopifypreview.com)
Live View Passcode: Khome200