Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Security2431/9cbcc7ff295ddaf867eb753392f9f699 to your computer and use it in GitHub Desktop.
Save Security2431/9cbcc7ff295ddaf867eb753392f9f699 to your computer and use it in GitHub Desktop.
wp change price with js
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