You are here:  » Category mapping issue

Support Forum



Category mapping issue

Submitted by marco@flapper on Tue, 2012-03-20 08:21 in

Somehow the category mapping is not done during import.

I ran the import with database debug on and I noticed the category='e readers' while I mapped that to "Ereaders". I remember from ticket http://www.pricetapestry.com/node/4147 that I had some changes for the 12/10B upgrade to Product Mapping that had been confused with category mapping, so the category mapping reference array was never being created! Maybe I used the old admin.php to built on?

Could you take a look at my admin.php to see if that is the problem?

{code saved}

Submitted by support on Tue, 2012-03-20 09:21

Hi Marco,

Does it appear that Category Mapping is not being applied at all; or just that particular example? Your version definitely has the correct code in place (search on $admin_importCategoryMappings ) however what I did notice which is a modification is normalisation of the $importRecord["category"] by the following line _after_ category mapping has /been applied:

$importRecord["category"] = tapestry_normalise($importRecord["category"],"\.");

The side effect of this is that category values picked out by the Helper Tool on the Category Mapping admin page may not exactly represent the category values as seen by the script at the time Category Mapping is applied.

If it looks like this may be the case; if you move the above line further up the script to _above_ the following comment:

/* apply category mappings */

...and then after the next import review your Category Mappings and use the helper tool to re-apply any transformations that you wish to make and that may be all it is...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Tue, 2012-03-20 12:38

Hi,
Changed it but it is behaving a bit strange. I imported it several times and I/it seems to miss a category.

It looks like the Helper tool is still not exactly representing the category values.

Some are applied when I import but I tried it several times by looking at the category page and mapping it with help of the Helper tool, but I'm still missing some categories...

Submitted by support on Tue, 2012-03-20 15:11

Hi Marco,

I wonder if this is down to the superfluous spaces issue where category values contain multiple spaces that are removed by the helper tool due to HTML rules.

In your includes/admin.php, look for the following comment:

    /* apply category mappings */

...and REPLACE with:

    /* apply category mappings */
    $importRecord["category"] = trim(preg_replace('/[ ]{2,}/',' ',$importRecord["category"]));

With that, and the previous recommendation of moving normalisation above mapping the Helper Tool should then reflect exactly the imported categories...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Tue, 2012-03-20 22:50

Hi,
It helps. Now I got all the categories mapped into one category.

thanks.

Submitted by marco@flapper on Wed, 2012-03-21 08:55

Hi,
Could I be having this issue to with the product mapping?

Submitted by support on Wed, 2012-03-21 09:02

Hi Marco,

It's certainly possible - exactly the same work around can be used. In your includes/admin.php, look for the following comment:

    /* apply product mappings */

...and REPLACE with:

    /* apply product mappings */
    $importRecord["name"] = trim(preg_replace('/[ ]{2,}/',' ',$importRecord["name"]));

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Fri, 2012-03-23 10:48

Thanks. This solved it.