Created
April 18, 2018 13:21
-
-
Save Security2431/9cbcc7ff295ddaf867eb753392f9f699 to your computer and use it in GitHub Desktop.
wp change price with js
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
var $price = $(".woocommerce-Price-amount"); | |
$price.each(function(index, item) { | |
var $this = $(item); | |
var text = $this.clone().children().remove().end().text(); | |
var $currency = $this.find(".woocommerce-Price-currencySymbol"); | |
$this.html(Number(text.replace(/[^0-9\.-]+/g,""))).append($currency); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment