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
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
- The email nag is not closable because the masthead hides the close button.
- 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.