You are here:  » Remove many categories from feed

Support Forum



Remove many categories from feed

Submitted by jonny5 on Wed, 2008-05-14 17:31 in

i have a feed and it has hundreds of categories and i only want a few , is there an easy way to drop must of these categories instead of doing it one by one in the filter section??

Submitted by support on Thu, 2008-05-15 06:27

Hi Jonny,

Check the code for a new filter (Drop Record If NOT RegExp) in this thread:

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

...you can register that new filter against the category field, and then use a RegExp (regular expression) like this to drop all except the few categories you want...

(Category1|Category2|Category3)

Cheers,
David.

Submitted by magnaromagna on Mon, 2010-06-07 05:10

Hello,
after import I see that some categories are empty or not working (because of the feed). Is there a way to remove them from public side? Can I perform this through category mapping or filter? I need something like:
if category = 123456 then remove/hide

Thanks!

Submitted by support on Mon, 2010-06-07 08:59

Hi,

The easiest that would not require on-going code modifications would be to create a category mapping with a master category name of "DELETEME", and then in the alternatives box enter the names of all the categories that you wish to remove from your site.

Then, in includes/admin.php, look for the following comment around line 236:

    /* apply product mappings */

(this is immediately AFTER the category mapping section)

...and REPLACE with:

    if ($importRecord["category"] == "DELETEME") $importRecord["category"] = "";
    /* apply product mappings */

Hope this helps!

Cheers,
David.