Post by sunriser » Fri Mar 02, 2012 2:08 am

Hi All,

Would it be possible to change the layout of the pricing in opencart?
Example:

Price is now displayed as: 3,95$
But I would like it to be displayed similar to: $3,95

Basically anything behind the decimal I would like to show in superscript.

Couldn't find anything related in searches.. anyone? :)

http://www.buddhalife.nl


New member

Posts

Joined
Sun Dec 18, 2011 8:03 pm


Post by Nesvarbu » Sat Apr 14, 2012 8:24 am

i need this too !!

Newbie

Posts

Joined
Sat Apr 14, 2012 8:05 am

Post by GoGo OpenCart » Tue Apr 17, 2012 7:34 pm

I just released a module that does that ;) Take a look at it:

http://www.opencart.com/index.php?route ... on_id=6019

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Active Member

Posts

Joined
Mon Nov 14, 2011 11:30 pm

Post by Nesvarbu » Fri Apr 27, 2012 12:28 am

GoGo OpenCart wrote:I just released a module that does that ;) Take a look at it:

http://www.opencart.com/index.php?route ... on_id=6019
Lol.... 15 Dollars....


<?php
$parts = explode('.', $price);
echo "$parts[0] <sup>$parts[1]</sup>";
?>

Newbie

Posts

Joined
Sat Apr 14, 2012 8:05 am

Post by Nesvarbu » Fri Apr 27, 2012 6:29 am

<?php
$pattern = '/([\d,]+\.)(\d+)(.*)$/';
$formatted = preg_replace($pattern, '$1<sup>$2</sup>$3', $price);
$parts = explode('.', $formatted);
echo "$parts[0] $parts[1]";
?>

Newbie

Posts

Joined
Sat Apr 14, 2012 8:05 am

Post by MrTech » Thu May 10, 2012 9:44 am

I have an extension that does what you want and takes it further by a couple steps (removes 00 decimals and adds a space between the price and currency):

http://www.opencart.com/index.php?route ... on_id=6013

~
Install Extensions OR OpenCart Fast Service! PayPal Accepted
I will professionally install and configure any free or purchased theme, module or extension.

Visit http://www.mrtech.ca if you need an OpenCart webmaster
~


User avatar
Active Member

Posts

Joined
Mon Jan 09, 2012 2:39 pm
Location - Canada, Eh!

Post by drmrbooster » Mon Nov 05, 2012 7:15 pm

Hello. I have a problem. My currency format is 18,999.00, but I want this 18.999,00. Can anyone tell me how to fix it? Thanks.

Newbie

Posts

Joined
Sun Oct 28, 2012 7:58 pm

Post by ooleonoo » Tue May 28, 2013 7:15 am

My extension will superscript the decimals of the price and removes decimals with zeros.

Example:
120.00 => 120
119.52 => 119.52

http://www.opencart.com/index.php?route ... h=decimals

Newbie

Posts

Joined
Sun Apr 07, 2013 9:52 pm
Who is online

Users browsing this forum: No registered users and 215 guests