Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Changing Shopping Cart Icon on Refresh Theme

Solved

Changing Shopping Cart Icon on Refresh Theme

Lheilers
Excursionist
34 0 6

In the cart snippet I changed the code to

 

<!--<svg class="icon icon-cart" aria-hidden="true" focusable="false" role="presentation" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" fill="none">
<path fill="currentColor" fill-rule="evenodd" d="M20.5 6.5a4.75 4.75 0 00-4.75 4.75v.56h-3.16l-.77 11.6a5 5 0 004.99 5.34h7.38a5 5 0 004.99-5.33l-.77-11.6h-3.16v-.57A4.75 4.75 0 0020.5 6.5zm3.75 5.31v-.56a3.75 3.75 0 10-7.5 0v.56h7.5zm-7.5 1h7.5v.56a3.75 3.75 0 11-7.5 0v-.56zm-1 0v.56a4.75 4.75 0 109.5 0v-.56h2.22l.71 10.67a4 4 0 01-3.99 4.27h-7.38a4 4 0 01-4-4.27l.72-10.67h2.22z"/>
</svg>-->
<img src="https://cdn.shopify.com/s/files/1/0617/7832/9797/files/cart.png?v=1654208085"width="30"/>

 

on my site https://halomattress.myshopify.com/

 

It is showing the new purse icon before I add to cart and then once i add to cart it changes to the cart icon.  I want it to show the cart icon at all times.  Please help.

Accepted Solution (1)

Crimson_Shot
Excursionist
12 1 1

This is an accepted solution.

He @Lheilers!

This is happening because there are actually 2 cart icons. One for empty cart and one for a cart with items, so when you add items to the cart, the second icon is being rendered.

You have 2 ways to fix this:

1. You change the second cart icon (you can find both cart icon files in the "snippets" folder)
   a. The full cart icon file name is: icon-cart.liquid

   b. The empty cart icon file name is: icon-cart-empty.liquid

 

2. Your second option would be to display only the empty cart icon at all times, and you can do that from the (header.liquid) file in the "sections" folder.


  a. Find this code snippet, and replace all the liquid code (from "if" to "endif") with the code in the second screenshot.

 

Old code:

Crimson_Shot_0-1654285330999.png

New Code:

Crimson_Shot_0-1654286162586.png

 

  b. Your final step would be to make the same change to the "cart-icon-bubble.liquid" file which is in the "sections" folder. 

Replace these lines:

Crimson_Shot_2-1654285856125.png

 

With this line of code:

Crimson_Shot_3-1654285937908.png

 

If this fixes your issue, please mark my reply as a solution.

View solution in original post

Reply 1 (1)

Crimson_Shot
Excursionist
12 1 1

This is an accepted solution.

He @Lheilers!

This is happening because there are actually 2 cart icons. One for empty cart and one for a cart with items, so when you add items to the cart, the second icon is being rendered.

You have 2 ways to fix this:

1. You change the second cart icon (you can find both cart icon files in the "snippets" folder)
   a. The full cart icon file name is: icon-cart.liquid

   b. The empty cart icon file name is: icon-cart-empty.liquid

 

2. Your second option would be to display only the empty cart icon at all times, and you can do that from the (header.liquid) file in the "sections" folder.


  a. Find this code snippet, and replace all the liquid code (from "if" to "endif") with the code in the second screenshot.

 

Old code:

Crimson_Shot_0-1654285330999.png

New Code:

Crimson_Shot_0-1654286162586.png

 

  b. Your final step would be to make the same change to the "cart-icon-bubble.liquid" file which is in the "sections" folder. 

Replace these lines:

Crimson_Shot_2-1654285856125.png

 

With this line of code:

Crimson_Shot_3-1654285937908.png

 

If this fixes your issue, please mark my reply as a solution.