Shopping Cart Icon changes when products are added/removed

Topic summary

A store owner is experiencing an issue where their custom shopping cart icon reverts to Shopify’s default bag icon whenever items are added to or removed from the cart. The custom icon displays correctly during normal browsing but switches back during cart updates.

Root Cause Identified:
When products are added to the cart, the cart count update triggers a full re-render of the icon, replacing the custom image with the default one. This is a JavaScript functionality issue rather than a CSS styling problem.

Proposed Solutions:

  • For Dawn-based themes: Replace SVGs in cart-icon-bubble.liquid and cart-notification-product.liquid files
  • Modify the renderContents function in cart-notification.js to update the image source for the cart notification element

Additional Issues Noted:

  • Email popup close button is hidden behind the masthead
  • JavaScript errors present in browser console (F12)
  • Apps like Yotpo and Fivy gift-cards causing script conflicts

The discussion remains open with technical guidance provided but no confirmed resolution yet.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

We have set up a custom image for our shopping cart and it works great majority of the time. It reverts back to the Shopify default image of the bag when an item is added to the cart or cleared from the cart. I have looked at some coding and cannot find an area to update or change where it is pulling the image from.

When drawer is open, back to default bag icon (bad)

Click off and continue shopping and it updates to correct image icon:

Our website: www.shimlee.com

Hi @shimlee ,
I’ve taken a look at your website and closely inspected the issue.
You have added a new icon for cart that is okay. But, when someone adds something to the cart, to update the cart count the full icon is rendered again and replaced with the old cart icon. This is something you need to work with the functionality of the add to cart click. Not some CSS tweak but you need to change the javascript functionality of it from the codebase.

Without the codebase, I can’t say more than that. So, I can just point out the issue. Thanks.

Would you be able to help us within our javascript functionality? I’ve tried to have it triggered when an event like “open drawer” happens but I don’t think it’s full correct, therefor not working.

Hi @shimlee :waving_hand: For dawn based themes that is the https://github.com/Shopify/dawn/blob/main/sections/cart-icon-bubble.liquid and

Reference https://github.com/Shopify/dawn/blob/main/sections/cart-notification-product.liquid

Replace the SVGs with relevant images.

Also be aware the site has many issues

  1. The email nag is not closable because the masthead hides the close button.
  2. Apps like customily and others are causing script issues, from inlined javascript possibly for vify-gift-cards (index):522 Uncaught TypeError: window.onload is not a function; observable in browser devtools console(F12)

Contact me for theme customizations and theme repair optimization services.

Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

Hello @shimlee ,
When we add a product to cart, in file cart-notification.js
renderContents’ function is called

In it cart Notification html is updated. There you will get complete cart notification element or node and just to need to update image src.