You are here:  » Multiple category fields in product feed


Multiple category fields in product feed

Submitted by tobyhage on Wed, 2018-04-04 13:03 in

Hello David,

Can you help me with following issue:

The product feed from Bol.com has a lot of category fields, for example:

<Gpc>
<segmentName>Personal Accessories</segmentName>
<familyName>Personal Accessories</familyName>
<className>Jewellery</className>
<brickName>10001090-Necklaces/Necklets</brickName>
<chunkName>Collier</chunkName>
</Gpc>
<Category>
<category>Jewelleryand Watches </category>
<productgroup>Necklaces</productgroup>
<productsubgroup>Jewellery</productsubgroup>
<subsubgroup>Necklaces</subsubgroup>
</Category>

On this moment i'am using one of this fields for my category field, but it would be handy if i can use multiple of these fields.

I have some thoughts about solutions, but i'am curious which solution you have to solve this.
Maybe it's also informative for other users.

I have searched the forum, but couldn't find a similar issue.

kind regards,

Toby.

Submitted by support on Wed, 2018-04-04 14:29

Hello Toby,

It's a straight forward mod to make the category field be able to contain a comma separated list of multiple categories (but not so easy to describe as replacements), as I know you have being using the script for some time if you would like to email me from your installation;

categories.php
search.php
html/searchfilters.php
includes/admin.php

...i'll apply the changes for you to try. The comma separated category field could then be constructed using a Text After filter, so for example with CATEGORY/CATEGORY mapped as the main Category field, you would add a Text After filter to the Category field and in the text box on the configuration page for the filter use:

,%CATEGORY/PRODUCTGROUP%,%CATEGORY/PRODUCTSUBGROUP%,%CATEGORY/SUBSUBGROUP$

Cheers,
David.
--
PriceTapestry.com

Submitted by tobyhage on Thu, 2018-04-05 18:53

David,

That would be very nice, but my source code is very much changed in the meantime :-).

I think i have forgotten to mention following information:
I only want to use the extra category field(s) to filter products during the import of the product feed.

I'am thinking about following solution.

1) make an extra custom category field, which can handle comma separated category fields
2) use the text after filter to fill this custom category field
3) and then i can use this custom category field with drop filter to filter products

If you think above solution is the best solution, i will make this myself.

Let me know what you think about this solution.
Thank you.

Regards,

Toby.

Submitted by support on Fri, 2018-04-06 10:01

Hi Toby,

That sounds good - and also the custom field can be long enough to hold all comma separated values (the documentation for custom fields uses VARCHAR(255) by default but can of course be longer) however the `category` field is only VARCHAR(32) by default in order to be included in multi-field indexes for search performance reasons...

Cheers,
David.
--
PriceTapestry.com