Hello again!
One of my merchant's used a comma when using prices over $999.99... resulting in a $24k (imagine the commission on that!) ring being displayed at $2.4!
I've tried using the script's wonderful find+replace feature to replace commas in the price field with, well, nothing, but that hasn't done the job.
Anybody got a fresh idea on this?
That makes a lot of sense!
Guess who'll get a cut of the commission if I ever sell anything over $999 ;-)
Glad to hear it. Having said the above, I contacted them and they've changed it which was rather nice of them.
Hi Harvey,
I can see what the problem is - so you have a price that is something like 34,567.89, and PT is turning that into $34.57.
The script is setup to handle feeds that use a comma instead of the decimal point; but in this case it seems that you have both!
To fix this, you'll need to make a change to the decimalise function in includes/tapestry.php, and this assumes that you are not using any other feeds that use a comma instead of a decimal point. Look for the following code:
<?php
function tapestry_decimalise($price)
{
$price = str_replace(",",".",$price);
$price = preg_replace('/[^0-9\.]/e','',$price);
$price = sprintf("%.2f",$price);
return $price;
}
?>
You will notice that the first line of this function converts commas into decimal places. In your scenario, you want to change this to simply remove commas, so change the function as follows:
<?php
function tapestry_decimalise($price)
{
$price = str_replace(",","",$price);
$price = preg_replace('/[^0-9\.]/e','',$price);
$price = sprintf("%.2f",$price);
return $price;
}
?>
It should then import with the correct price!
Hope this help!
David.