Skip to content

Instantly share code, notes, and snippets.

@geetfun
Created November 22, 2016 16:50
Show Gist options
  • Save geetfun/a5eb795de67ae4128fb14fd9961403e6 to your computer and use it in GitHub Desktop.
Save geetfun/a5eb795de67ae4128fb14fd9961403e6 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
var calculateCartTotal = function() {
var total = 0;
$('[data-checkend-total-price]').each(function(index, element) {
var string = $(element).html();
console.log(string);
string = string.trim();
string = string.replace(",", "")
total += parseFloat(string.replace(/[^0-9]/, ''));
});
console.log(total);
$('[data-checkend-total-cart-price]').html("$ " + total.toFixed(2));
}
if (window.subscriptionOrderApp) {
$('.cart__additional_checkout').hide();
$('.cart__note-add').hide();
setTimeout(function() {
calculateCartTotal();
}, 500);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment