You are here:  » Non Formatted Prices


Non Formatted Prices

Submitted by multiz on Fri, 2006-07-28 18:01 in

Hello again,
I've gotten some new datafeeds, but I'm having problems with non formatted prices. Such as 899 not being displayed as 8.99 but instead being displayed as 899.00. Do you have any suggestions?

Submitted by support on Fri, 2006-07-28 18:19

Hi,

As long as the price format is consistent in the feed then a filter could be used to divide the value by 100 before importing.

Depending upon when you last downloaded Price Tapestry, the "Price" column may or may not be an option in the filter list when selecting which field to register a filter against. If you do not have the option; either download the latest version and extract filter files (admin/feeds_filters_*) from the distribution; or make the changes as described in this thread:

http://www.pricetapestry.com/node/352

Now, to create a new filter to divide the price by 100, add the following code to includes/filter.php:

<?php
  
/*************************************************/
  /* Div100                                        */
  /*************************************************/
  
$filter_names["div100"] = "Div 100";
  function 
filter_div100Configure($filter_data)
  {
    print 
"<p>There are no additional configuration parameters for this filter.</p>";
  }
  function 
filter_div100Validate($filter_data)
  {
  }
  function 
filter_div100Exec($filter_data,$text)
  {
    return (
intval($text) / 100);
  }
?>

That should do the trick!
Cheers,
David.

Submitted by multiz on Fri, 2006-07-28 19:33

Thanks it works! I have another question related to large feeds. How would it be possible to allow more time for my server to import large feeds? Thanks for everything.

Software and Video Games Price Comparison

Submitted by support on Fri, 2006-07-28 20:35

Hi,

For very large feeds the best way to import is using the automation scripts. For this, you will need to be able to login into your server via Telnet or SSH, and then change to your Price Tapestry /scripts folder.

From there, you can type the command:

$php import.php filename

(more information here)

You need to do this after registering the feed using the admin interface; and perhaps doing a trial import (10 records) first.

Cheers,
David.