Discussions

Add span to price after decimal point

Hello

On my product display I would like to add a span or a sup element so I can make my .99 prices display in superscript

like this

http://www.magentocommerce.com/boards/viewthread/43075/

I wonder how is the best way of injecting this into my template to do this.

Thank you

David

Posted: Nov 1, 2013

Comments

edu on November 4, 2013

Quick-and-dirty solution using jQuery

        var price = $(".field-name-commerce-price .field-item").text();
        price = price.replace(" ", "</sup>");
        price = price.replace(".", "<sup>.");
     
        $(".field-name-commerce-price div.field-item").html(price);