This function is responsible for updating the cart successfully
success: function(json) {
// Setting a timeout to ensure total update
setTimeout(function () {
$('#cart > button').html('<span id="cart-total-remove"><img src="http://localhost/nerv/image/catalog/icons/bag.png"/> ' + json['total'] + '</span>');
}, 100);
if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') {
location = 'index.php?route=checkout/cart';
} else {
$('#cart > ul').load('index.php?route=common/cart/info ul li');
}
},
I also included the class "change-remove" for later styling purposes
$(document).ready(function() {
if ( window.location.href == 'http://localhost/nerv/index.php?route=common/home' ){
$("#cart #cart-total-remove img").removeClass("change-remove");
} else {
$("#cart #cart-total-remove img").addClass("change-remove");
console.log(window.location.href);
}
});
Below are my custom CSS styles
#cart #cart-total-remove img {
filter: invert(1);
}
#cart #cart-total-remove img.change-remove{
filter: none;
}
I would greatly appreciate any advice or assistance