You are here:  » I have some problems with a data feed

Support Forum



I have some problems with a data feed

Submitted by pgabriel on Thu, 2007-02-22 18:22 in

Hello,

I have a csv feed and i have some problems with the categories
The categories from feed look like this

Category
Category::Subcategory
Category::Subcategory::Sub-Subcategory

I wish to remove the "Category::Subcategory"

Then, when is outputs the file looks like this:

Category
CategorySubcategory
CategorySubcategorySub-Subcategory

Help plz.

Submitted by support on Thu, 2007-02-22 18:25

Hi,

There is a solution for this in the second message in this thread:

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

Then, add a new "Explode" filter to the category, enter "::" as the text to split on, and -1 as the return index. This will return the last value in the list separated by "::".

However, just like in the other thread before this will work you will have to permit the ":" character in the category field. In includes/admin.php look for the following code on line 170:

$record[$admin_importFeed["field_category"]] = tapestry_normalise($record[$admin_importFeed["field_category"]]);

Change this as follows to allow the ":" character:

$record[$admin_importFeed["field_category"]] = tapestry_normalise($record[$admin_importFeed["field_category"]],":");

Hope this helps!
Cheers,
David.

Submitted by pgabriel on Fri, 2007-02-23 12:52

David,

If i make this change:

$record[$admin_importFeed["field_category"]] = tapestry_normalise($record[$admin_importFeed["field_category"]],":");

I have no results for categories.

Thanks,
Gabriel

Submitted by support on Fri, 2007-02-23 17:35

Hi Gabriel,

Is that just with the single modification above, or having included the Explode filter and registering that against the category field?

To verify, if you could roll-back that change and make sure that you can then import categories again - then remake the change as above and let me know how you get on...

Cheers,
David.