Jump to content

Smaller font for decimals


Recommended Posts

Quick way with javascript.

 

Add the following JS code at the end of the file product.js:

$(function(){
	var price = $('#our_price_display').text();
	var sign = price.slice(-1);
	price = price.substring(0, price.length - 1).trim();
	var res = price.split(",");
	var new_price = res[0]+'<sup>'+res[1]+'</sup> '+sign;
	$('#our_price_display').html(new_price);
});
Link to comment
Share on other sites

Thanks a lot, it works great for products without combinations, I've made 2-3 minor changes to fit my prices:

 

 

$(function(){

var price = $('#our_price_display').text();
var sign = price.slice(-3);
price = price.substring(0, price.length - 3).trim();
var res = price.split(".");
var new_price = res[0]+'<sup style="vertical-align:super;font-size:12px">'+res[1]+'</sup> '+sign;
$('#our_price_display').html(new_price);
});

 

How can I display prices this way all over the site? Eq for products with combinations, in home page, product list, cart etc. ?

Edited by diana13 (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...
  • 2 years later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...