I got item price $2,000.00 and it displays $2.00.
If the price in the feed is 2000.00, it will display correct.
But if the price in the feed is 2,000.00, then it will display $2.00
How to remove the comma in Price field when import?
Thanks
Hi David
I got a similar problem, but it doesn't help outcomment this linie 36
I got item price $2.000,00 and it displays $2.00.
- notice that ',' and '.' is different from the first post.
If I change to $2,000.00 and outcomment linie 36, then it is displayed correctly.
thx
//Brian
Hi Brian,
In that scenario, instead of deleting that line, REPLACE with the following:
$price = str_replace(".","",$price);
$price = str_replace(",",".",$price);
Cheers,
David.
--
PriceTapestry.com
Hi David
Thx for your feedback...
your reply results this: $2000.00
If possible i like to have $2000,00 as a result - this is the normal way in Denmark, using comma as seperator :o)
thx
Brian
Hi Brian,
As price values are stored in the database in DECIMAL(10,2) format this would need to be handled at the display level - but is easy to do.
In each of the following files:
html/featured.php
html/searchresults.php
html/prices.php
Search and replace:
$product["price"]
...with:
str_replace(".",".",$product["price"])
And in
html/product.php
Search and replace:
$mainProduct["price"]
...with:
str_replace(".",".",$mainProduct["price"])
Cheers,
David.
--
PriceTapestry.com
Hi David
that almost did the trick - but this ".","." should be replaced with ".",","
then it display 2000,00
thx again
//Brian
Hi David,
Tried this mod, all right in html/featured.php, html/searchresults.php and html/product.php, I just cannot display prices in html/price.php.
In html/prices.php,I have replaced:
<?php
print $config_currencyHTML.$product["price"];
?>
with
<?php
print $config_currencyHTML.str_replace(".",",",$product["price"]);
?>
Prices are not displayed just here, I have been doing something wrong, cannot find out what exactly.
The strange thing is that featured, searchresults and product are OK !
Thanks in advance
Hello Misalf,
That looks absolutely fine, I assume it works OK if you revert back to the original? If you're still not sure, could you post the contents of your modified html/prices.php and I'll check it all in context...
Cheers,
David.
--
PriceTapestry.com
Many thanks David !
I post here the whole fix in order to remove comma in price field product.php, in case someone else need it:
Line 23 of product.php:
Change:
<?php print $config_currencyHTML.$mainProduct["price"]; ?>
with
<?php print $config_currencyHTML.str_replace(".",",",$mainProduct["price"]); ?>
Line 27 of product.php:
Change:
<?php if ($priceProduct["price"] == $mainProduct["price"]): ?>
with
<?php if ($priceProduct["price"] == str_replace(".",",",$priceProduct["price"])): ?>
Thanks for helping!
By the way, new Distribution 12/10B is GREAT !
Greetings
Thanks for your comments!
Cheers,
David.
--
PriceTapestry.com
Hi,
This is happening because of code built into handle comma as a decimal point - but it's easy to remove. In includes/tapestry.php look for the following code at line 36:
$price = str_replace(",",".",$price);
...and simply delete or comment out that line and then re-import any affected feeds.
Cheers,
David.
--
PriceTapestry.com