You are here:  » Price format problem

Support Forum



Price format problem

Submitted by technoarenasol on Mon, 2012-11-19 13:04 in

Hi David

Sometime In feed price column come with special like 2,300 So problem at time import..can any filter for remove special price format ??

Thanks
Amin

Submitted by support on Mon, 2012-11-19 13:25

Hello Amin,

The default decimalisation code is set-up to handle currencies that use comma as the decimal separator, but occasionally this can cause an issue where comma is used as a thousands separator. To correct this with a universal version (to be included in the next update to Price Tapestry coming shortly) edit includes/tapestry.php and look for the following code at line 36:

    $price = str_replace(",",".",$price);

...and REPLACE with:

    if ($c = strpos($price,","))
    {
      if ($d = strpos($price,"."))
      {
        if ($c < $d)
        {
          $price = str_replace(",","",$price);
        }
        else
        {
          $price = str_replace(".","",$price);
          $price = str_replace(",",".",$price);
        }
      }
      else
      {
        $price = str_replace(",",".",$price);
      }
    }

This is a universal version of the decimalisation process that will handle any combination of, for example

1.23
1,23
1,234.45
1.234,45
etc.

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Mon, 2012-11-19 13:30

Thnx again David :) ..we hope lots of new in upcoming version

Submitted by technoarenasol on Mon, 2012-11-19 13:56

Hi David,

Any problem if I am rename sitemap.php file?

Submitted by support on Mon, 2012-11-19 14:11

Hi Amin,

You can - but sitemap.php refers to itself at line 64:

  $sitemapHREF = "sitemap.php?filename=".urlencode($row["filename"]);

...so if you rename, then also change "sitemap.php" in the above line to be the same...

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Mon, 2012-11-19 14:16

technoarenasol

Hi David..you give me modified version sitemap for master.csv

code of modified version :

{code saved}

Submitted by support on Mon, 2012-11-19 14:21

Hi Amin,

I forgot you have a custom version. Your version does not reference itself so yes you can just change the name to whatever you like (but must end .php so it is processed by PHP).

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Mon, 2012-11-19 14:22

Ok David..Thnx

Submitted by AD_Mega on Thu, 2012-11-29 04:01

I'm having a price problem also. 29.99 shows as 2999.00 for some reason. So far it looks like it's happening to just one datafeed.

Submitted by support on Thu, 2012-11-29 20:19

Hi,

That looks like the price is provided in pence (no decimals) in that feed - whilst this is rare I have come across this before, there is a Div100 filter that will correct this in this thread...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by AD_Mega on Thu, 2012-11-29 21:09

Hi David

I check the datafeed and the price has a decimal. For some reason 29.99 price that is in the datafeed is showing 2999.00. I have imported the feed several times but no change.

Submitted by support on Fri, 2012-11-30 10:22

Hi Adrian,

That's interesting; please could you let me know the URL of the installation and the filename of the feed that is causing the problem (and product name if possible) - i'll remove before publishing your reply - and I'll download the feed to my test server and check it out for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by AD_Mega on Fri, 2012-11-30 16:59

Hi

{link saved}

Submitted by support on Fri, 2012-11-30 17:37

Hi Adrian,

It worked fine on my test server, and imported the latest price of 15.99. Please could you email me your latest includes/tapestry.php and I will check it out...

Cheers,
David.
--
PriceTapestry.com