I am trying to change the shopping cart icon whenever the cart is empty. However, I need to refresh the page to see the change.
I made the if loop saying if cart.item_count is equal to 0, my source image will load.
<a href=“{{ routes.cart_url }}” class=“Heading u-h6” {% unless template == ‘cart’ or settings.cart_type == ‘page’ %}data-action=“open-drawer” data-drawer-id=“sidebar-cart” aria-label=“{{ ‘header.navigation.open_cart’ | t }}”{% endunless %}> {% if cart.item_count == 0 %} {% endif %}
So the image loads but it needs to load without refreshing the page. How do I make this happen? Thanks