You are here:  » Integer Price


Integer Price

Submitted by technoarenasol on Thu, 2012-10-11 15:13 in

Hi David

How can convert float price into integer price

Submitted by support on Fri, 2012-10-12 08:54

Hello technoarenasol,

Since the `price` field is stored in the database as DECIMAL(10,2) it is formatted in the results of a query as 0.00 (actually as string) but rather than suggest changing the type at this stage I would recommend using intval() wherever the price is displayed. You can do this with a simple Search and Replace using your text editor as follows;

In html/prices.php and html/featured.php

Search:

$product["price"]

Replace:

intval($product["price"])

In html/product.php

$priceProduct["price"]

Replace:

intval($priceProduct["price"])

And finally in html/searchresults.php

$product["minprice"]

Replace:

intval($product["minPrice"])

Cheers,
David.
--
PriceTapestry.com