You are here:  » > Stripped From Category Name on Feed Import


> Stripped From Category Name on Feed Import

Submitted by bat on Tue, 2022-08-02 16:32 in

Hi David,
I've noticed that my installation seems to automatically strip out the symbol > from category name in feeds upon import.

I wanted to use an explode filter on > and -1 index to return the last segment of the category name but can't in its current state.

Is there any way to include the > symbol or exclude it from stripping it out upon import?

Thank you

Submitted by support on Wed, 2022-08-03 08:18

Hi,

Sure; to do this, edit includes/admin.php and look for the following code at line 198:

      $importRecord["category"] = tapestry_normalise($importRecord["category"]);

...and REPLACE with:

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

Cheers,
David.
--
PriceTapestry.com

Submitted by bat on Wed, 2022-08-03 21:15

Thanks, worked a treat!

Submitted by bat on Thu, 2022-08-04 00:19

Hi David,
I've noticed that exact match on category hierarchy isn't working as it should on my installation and it seems partially to be a result of this change.

If I use the = sign next to any of the categories I map for exact match, when I import the feed it doesn't import that particular category's products. The minute I remove the = sign so it's a 'category contains keywords/phrase' match, and import, the products for that mentioned category show up within my custom category.

This is since I've changed it so > is included on import. If I revert back, it works fine.

However, regardless if > is included or not on category when importing feed, on reverse category hierarchy mapping I can map categories using the dropdown but the minute I click save to apply the change, it doesn't save any of my choices so this must have been a problem before this change and I hadn't realised.

Categories that have been 'keyword mapped' through the 'category contains keywords' match on category hierarchy do appear though so the problem seems to lie with the exact match somewhere.

I'm not sure what mods I have in place on my installation in regards to category/mapping as it's been a while but I know I included these:
https://www.pricetapestry.com/node/6236
and allowing mapping using Regex

Submitted by support on Thu, 2022-08-04 08:01

Hi,

I would suggest applying the full normalisation after filters in that case; that way mapping should work exactly as before; although any feed category values that have been changed by the Explode filter and -1 offset would need to be changed in the mapping configurations.

To do this edit includes/admin.php and look for the following code at line 259:

    if ($filter_dropRecordFlag) return;

...and REPLACE with:

    if ($filter_dropRecordFlag) return;
    $importRecord["category"] = tapestry_normalise($importRecord["category"]);

Cheers,
David.
--
PriceTapestry.com

Submitted by bat on Thu, 2022-08-04 11:24

Thanks David, the mapping is now working with the =