Last active
December 28, 2015 01:19
-
-
Save SmellyFish/7420007 to your computer and use it in GitHub Desktop.
jQuery code to remove decimals on the front end.
This file contains 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
jQuery(function(){ | |
$('.sprice, #price, #cartItems .list, #orderDetails .list, #orderList tr td').each(function(){ | |
cleanPriceText($(this)); | |
}); | |
}); | |
function cleanPriceText($ele){ | |
var text; | |
text = $ele.text(); | |
text = text.replace(/(\$[0-9\.\,\s]+)\.00/g, '$1'); | |
$ele.text(text); | |
} | |
function customProductDetailChangePriceHandler(){ | |
cleanPriceText($('#price')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment