I am trying to calculate tax on items using jQuery. The CRM I use has something called tags that take the form of {tag_something} to dynamically read information onto the webpage. I want to update the price of a product using jQuery. (later to be implemented for state specific tax). The code I have is changing the original price, but instead of changing it to what it needs to be, it instead defaults to "0" on the page. Any ideas or suggestions would be greatly appreciated. The product I have set up for this is: http://www.bemidjisportsonline.com/accessories/backpacks/klim-nac-pak
<!-- taxable items -->
jQuery(document).ready(function() {
initUpdateTax();
}
);
function initUpdateTax() {
var taxable = '{tag_taxcode}';
var saleprice = '{tag_saleprice}';
if (taxable == "Accessories"){
$('#taxable').text(function(saleprice) {
return Math.round(parseInt(saleprice + (saleprice * 0.06875));
});
}
}