On my site it shows price like this
211.00:-
I want it to only show
211:-
how do i do?
Hi David
it did work very well, got problem with the currency symbol in the product.php page i want it on the right side.
<?php print tapestry_price($mainProduct["price"]); ?> <?php print translate("from"); ?>
how do i ad it to this row?
Hi,
In each of the html/ files where price is displayed, the original code would display $config_currencyHTML prior to the price; e.g.
$config_currencyHTML.$product["price"]
...so swapping them around would be just:
$product["price"].$config_currencyHTML
In your line of code (which I think won't be displaying the currency at all at the moment) use:
<?php print tapestry_price($mainProduct["price"]).$config_currencyHTML; ?> <?php print translate("from"); ?>
Cheers,
David.
--
PriceTapestry.com
Thx it did work very well.
i did get ride of all the .00 but not on the compare line in the serchresults.php
on this line:
<em><?php print translate("from"); ?></em> <strong><?php print $product["minPrice"].$config_currencyHTML; ?></strong><br />
how can i change this line of code so the price don´t show .00?
Hi,
Using your new tapestry_price function that line would be:
<em><?php print translate("from"); ?></em> <strong><?php print tapestry_price($product["minPrice"]).$config_currencyHTML; ?></strong><br />
Cheers,
David.
--
PriceTapestry.com
Hi,
As the price field is stored as DECIMAL in the database; they are coming out of the database with 2 zero-padded decimals. What you would need to do is create a display function to convert this to the format require. I would suggest adding this to includes/tapestry.php by adding the following code to the end of the script; just before the closing PHP tag:
function tapestry_price($price)
{
return sprintf("%d",$price);
}
Finally, wherever a price value is displayed within the /html/ files, enclose, within the above function. The easiest way to do this would be to do a Search and Replace with your text editor of:
$product["price"]
...REPLACE with:
tapestry_price($product["price"])
In the following files:
html/featured.php
html/prices.php
html/searchresults.php
And of
$mainProduct["price"]
...REPLACE with:
tapestry_price($mainProduct["price"])
in html/product.php
Cheers,
David.
--
PriceTapestry.com