OpenStore
OpenStore copied to clipboard
Minicart not refreshing when named other than MiniCart.cshtml
Ran into an issue where the minicart doesn't get updated wqhen you have selected a razor script with a different name than MiniCart.cshtml.
This is caused by this javascript function (in both Themes/Default/js/product.js AND Themes/Bootstrap4/js\product.js):
if (e.cmd === 'cart_addtobasket') { $('.processingminicart').show(); $('input[id*="optionfilelist"]').val(''); // clear any clientupload file names $('#carttemplate').val('MiniCart.cshtml'); nbxproductget('cart_renderminicart', '#productajaxview', '.container_classicajax_minicart'); // Reload Cart $('.addedtobasket').delay(1000).fadeOut('fast'); }
This code uses the class "container_classicajax_minicart" to find the minicart module, but this has the razor script's name in it.