You are here:  » Custom Category in Product Mapping

Support Forum



Custom Category in Product Mapping

Submitted by allanch on Fri, 2011-07-22 06:51 in

Good morning David,

I hope you're well. I've tried putting a custom category when product mapping but after importing a feed again the category doesn't appear in categories.php. Can you tell me if a custom category has to be an existing one as set out by a feed or if there has to be an '=' before it as in the case of the new product mapping procedure or if I'm doing something else wrong? Thanks

Submitted by support on Fri, 2011-07-22 08:21

Hi Alan,

It doesn't need to be an existing category, and no = is required.

Is this from a new installation or after running the upgrade? If you've used the upgrade patch, double check the changes described in the upgrade notes here have been applied correctly and that upgrade.php ran (you can confirm this by making sure that a custom category is saved correctly). If you're still not sure, if you could email me a link to the installation, any password required for /admin/ and a copy of your includes/admin.php I'll check it out for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by allanch on Fri, 2011-07-22 09:49

Thanks David, sorry my mistake I forgot to add that bit of code to includes/admin.php. Can I confirm that I replace:

    /* check product record for minimum required fields */
    if (!$importRecord["name"] || !$importRecord["buy_url"] || !$importRecord["price"]) return;

with:

    global $admin_importProductMappingsOverrides;
    if (isset($admin_importProductMappingsOverrides[$importRecord["name"]]))
    {
      if ($admin_importProductMappingsOverrides[$importRecord["name"]]["description"]) $importRecord["description"] = $admin_importProductMappingsOverrides[$importRecord["name"]]["description"];
      if ($admin_importProductMappingsOverrides[$importRecord["name"]]["category"]) $importRecord["category"] = $admin_importProductMappingsOverrides[$importRecord["name"]]["category"];
      if ($admin_importProductMappingsOverrides[$importRecord["name"]]["brand"]) $importRecord["brand"] = $admin_importProductMappingsOverrides[$importRecord["name"]]["brand"];
      if ($admin_importProductMappingsOverrides[$importRecord["name"]]["image_url"]) $importRecord["image_url"] = $admin_importProductMappingsOverrides[$importRecord["name"]]["image_url"];
    }
    global $config_nicheMode;
    if ($config_nicheMode)
    {
      if (!in_array($importRecord["name"],$admin_importProductMappings)) return;
    }

as the instuctions have:

/* check product record for minimum required fields */

at the end so I'm not sure that goes before this. Thanks

Submitted by support on Fri, 2011-07-22 09:59

Hello Allan,

Not quite - the replacement is just of this line:

   /* check product record for minimum required fields */

...so after you have replaced the above with the new code, it will end with that same line..

If you're not sure, feel free to email me your includes/admin.php and I'll make the changes for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by allanch on Fri, 2011-07-22 10:48

Thanks David, I understand now, my brain was just winding down for weekend a bit too early!