Forums / Setting Up Categories, Products, Attributes / Display pricing with 2 and 3 decimals

Display pricing with 2 and 3 decimals

Locked

Views: 765

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
12 Oct 2010, 7:39 PM
#1
tim_m avatar

tim_m

New Zenner

Join Date:
Jan 2009
Posts:
22
Plugin Contributions:
0

Display pricing with 2 and 3 decimals

Some of my products are priced to 3 decimals, while others are priced to 2 decimals.

I want to show a product as $0.165 and another as $19.95.

I know I can change the decimals in the currency, but I do not want to show a price as $19.950.

Is there a way to show both?

12 Oct 2010, 9:16 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Display pricing with 2 and 3 decimals

This is open source, so this sort of thing is always possible.

But to do this would require an infrastructure to handle the number of decimal places on a per product basis. Zen Cart hasn't have such an infrastructure, so you'd have to program it yourself.

Provided you have programming skills that may not be as daunting as it sounds. You'd need to extend the product table to add a field for the number of decimal places to display, add the new field to product maintenance page in the admin and tweak the pricing function that formats the price to use the product level field in place of the currency level field.

Product prices themselves are already held to four decimal places internally, so you would have no need to change anything there.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)