You are here:  » Duplicate Category Data on Feed Import

Support Forum



Duplicate Category Data on Feed Import

Submitted by peterb on Tue, 2012-04-10 03:03 in

On xml import I would like to duplicate my 'category' field data into another field called 'category_map' in my 'feeds' table.

I would like this to be done before the 'global filters' or 'category mapping' is applied to the import data.

Can you help me with this please.

Submitted by support on Tue, 2012-04-10 07:53

Hi Peter,

If all your feeds are the same format, simply go to Global Filters and add a new Text After filter to your category_map field. In the text box on the configuration page for the filter use the placeholder

%CATEGORY%

...where CATEGORY is the field name within your feeds that is registered as the category field.

If that's not an option because your feeds have different formats a single line of code at the top of the import record handler function in includes/admin.php will do the trick - look for the following comment around line 216:

    /* apply user filters */

...and insert immediately before that point:

  $importRecord["category_map"] = $importRecord["category"];

...and that will set your new category_map field to be equivalent to the category field regardless of feed format or registration...

Cheers,
David.
--
PriceTapestry.com

Submitted by peterb on Tue, 2012-04-10 16:09

Option 2 worked perfectly for me.
Thankyou again David, your support is Phenomenal.