Created
November 22, 2016 16:50
-
-
Save geetfun/a5eb795de67ae4128fb14fd9961403e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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