You are here:  » Reject products without mapped category


Reject products without mapped category

Submitted by Chani on Tue, 2007-01-09 16:22 in

Hi,

Is it possible to reject a product, during import, when the product category does not match either the master or mapped categories?

Thanks!

Submitted by support on Tue, 2007-01-09 17:06

Hello Chani,

This can be done with a single mod to the import record handler if it's easy enough for you to go through each Category Mapping and create an entry for the master category in the list of mappings. This saves making another mod to be able to detect master categories easily.

Then, in includes/admin.php look for the following code, starting at line 220:

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

Here, we can simply return false in the case where there is no category mapping, so modify this code as follows:

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

That should do the trick;
Cheers,
David.

Submitted by Chani on Wed, 2007-01-10 09:20

That worked! Thanks :)