You are here:  » Cat Mapping before filters

Support Forum



Cat Mapping before filters

Submitted by meno on Wed, 2006-12-13 00:09 in

Is it possible to get the category mapping done before the filters run so i can map for example red green blue yellow to "colours" and then run a filter on "colours" ?

Thanks

Submitted by support on Wed, 2006-12-13 08:33

Hi,

Would this be so you can use text after etc. filters? You should be able to do this by moving the code around and changing the way the category mapping is applied.

In includes/admin.php you fill find the following code in the admin_importRecordHandler() function:

    /* apply category mappings */
    if (isset($admin_importCategoryMappings[$category]))
    {
      $category = $admin_importCategoryMappings[$category];
    }

To do what you want, first you need to change this code to:

    /* apply category mappings */
    if (isset($admin_importCategoryMappings[$category]))
    {
      $record[$admin_importFeed["field_category"]] = $admin_importCategoryMappings[$category];
    }

...and then move it further up the function, to the line before:

    /* apply user filters */

You should then be able to create a filter on the CATEGORY field that works on the value of the mapped category instead of the original...

Cheers,
David.