You are here:  » help with categories, and products within them


help with categories, and products within them

Submitted by ZiiPJester on Tue, 2010-12-07 15:00 in

Hi David,

I've been playing the PT script for a couple of weeks now. Absolutely loving it, but I appear to be a struggling with a couple of things that hopefully you can point me in the correct direction of a solution.

Basically, my first site is a game price comparison site. Its got about 14 individual feeds, which I download locally as CSV's, parse manually to some degree because they frankly come in a complete mess, then upload. Now, whilst it only takes about 10 to 20 minutes per feed to sort, its not ideal.

The biggest issue is the platform (Xbox, PS3, PC etc) that each item is available in.

What I find is that if I import the games from a feed, it only uploads 1 of any particular game - and ignores dupilcates on other platforms, even if the specified category is different.

To get around this, I make sure that the categories are the same between every feed (so there isn't XBOX360, XBOX-360, X360 etc) and then use the "After text" filter to add it to the category name. If I import after doing this, I get every version of every game.

Now, what takes a lot of time is normalising the platforms from the CSVs. Some feeds are particular useless - ASDA for example, doesn't have a column for platform - The only way I can do it is use regular expressions to take out a directory name from a deeplink that happens to mention the game platform. Crazy I know.

Now, this is where you could really help, and where i'm stuck..

I've tried using some of the filters built into PT - which seem to be able to do a majority of what I want, however, they don't seem to follow over between each other. For example, If I filter a category to remove data using explode etc, then add the category to the product name with the "after text" filter, it doesn't add the filtered version, only the original.

I hope this makes some form of sense. What is the best way for me to proceed and develop forward?

Kind regards,

James

Submitted by support on Tue, 2010-12-07 15:24

Hi James,

I understand - it's an easy mod to make %PLACEHOLDERS% contain the value as modified by earlier filters. In includes/admin.php, look for the following code at line 195:

    $importRecord[$filter["field"]] = $execFunction($filter["data"],$importRecord[$filter["field"]]);

...and REPLACE with:

    $importRecord[$filter["field"]] = $execFunction($filter["data"],$importRecord[$filter["field"]]);
    $filter_record[$admin_importFeed["field_".$filter["field"]]] = $importRecord[$filter["field"]]

Cheers,
David.
--
PriceTapestry.com

Submitted by ZiiPJester on Wed, 2010-12-08 10:47

Cheers David, such a simple fix for quite a long question lol

On a related note, I'm trying to get the platform out of the following string "GAMES - Games - DS - Education"

I changed the line in /includes/admin.php to:

$importRecord["category"] = tapestry_normalise($importRecord["category"], "\"\/\(\-");

But the hyphens still keep disappearing and are not visiable to the filters, so they can't pick them up as a reference point to explode.

What am I doing wrong?

Thanks,

James

Submitted by support on Wed, 2010-12-08 14:39

Hi James,

tapestry_normalise() removes hyphens regardless of the $allow parameter - see line 20 of includes/tapestry.php however that is important for quite a lot of clean URL functionality, so one option would be to move normalisation until after user filters have been applied. To do this, take the line that you identified but together with it's enclosing IF statement:

    if ($importRecord["category"])
    {
      $importRecord["category"] = tapestry_normalise($importRecord["category"]);
    }

...and move that block to just below the following code at line 201:

    if ($filter_dropRecordFlag) return;

Hope this helps!

Cheers,
David.
--
PriceTapestry.com