You are here:  » Category Filter Import


Category Filter Import

Submitted by lunen on Tue, 2012-05-15 13:58 in

Hi David,

I hope spring is treating you well. I'm working on a bulk update of all my categories (~10,000). Most of these are categories provided my a number of merchants, so I'm trying to (slowly) create only 100 real categories to display on the site. I'm doing this in a spreadsheet/access database, so I'd like to import the results back into the pt_categories table at the end, so have a few questions before I get too far along.

1)when importing the table back into pt, how can I get the line breaks need in the alternatives field.
2)is it possible to only display the these new filter categories on the categories page?

thanks in advance!

Submitted by support on Wed, 2012-05-16 18:24

Hi Lunen,

A line break is ASCII character 10 (decimal) so when you prepare your custom alternatives field; you need to include that between each option. In PHP, you would insert that using the code:

char(10)

or

"\n"

(back-slash is the "escape" character, and "n" means "new line")

In terms of importing only mapped characters - yes, this can be done in exactly the same way as Niche Mode (only mapped products are imported) is implemented... in includes/admin.php, look for the following comment at line 315:

    /* niche mode */

...and add the following code at this point:

    if (!in_array($importRecord["category"],$admin_importCategoryMappings)) return;

Cheers,
David.
--
PriceTapestry.com

Submitted by lunen on Sun, 2012-06-17 02:49

so once a category is mapped, will only the new "mapped" category show up on the categories page? not all the child categories that have been mapped to it? When I did what you described above it only imported the products that I have mapped categories for.

I'm slowly doing the mapping process, so I can use the above if needed once I'm done.... I was just wondering if I even need to do that if the category mappings actually take over the "old" categories.

Submitted by support on Sun, 2012-06-17 08:51

Hi Lunen,

That's correct - after import there's no concept of the pre-mapped categories in the database since they have been changed to the mapped name, so if you're ultimately aiming for total mapping then yes, there would be no need for the above modification...

Cheers,
David.
--
PriceTapestry.com