When I import from a merchant, my categories look like this:
drogisterijartikelenparfumsherendouchegel
drogisterijartikelenparfumsherengeurenadidas
drogisterijartikelenparfumsherengeurenaramis
drogisterijartikelenparfumsherengeurenburberry
drogisterijartikelenparfumsherengeurenbvlgari
drogisterijartikelenparfumsherengeurencacharel
drogisterijartikelenparfumsherengeurencalvinklein
drogisterijartikelenparfumsherengeurenchristiandior
drogisterijartikelenparfumsherengeurenclinique
drogisterijartikelenparfumsherengeurendavidoff
drogisterijartikelenparfumsherengeurendiesel
drogisterijartikelenparfumsherengeurendolcegabbana
drogisterijartikelenparfumsherengeurenemporioarmani
drogisterij = drug store
artikel = article
parfums= perfume
heren= men
etc.
I want seperate categories for: drug store / Perfume/ men/ etc...
How can I split these words up and make automaticaly categories?
Thank you for the advice!
Al
Hi,
A possible better solution for this came up recently - Wildcard category mapping. See this thread for the code:
http://www.pricetapestry.com/node/1892
For example in your case, you could create a category for "Parfum Heren", with the following in the category mapping box:
drogisterijartikelenparfumsheren*
Cheers,
David.
This /node/1892 does part of the job. That works great. Just tried it.
However I would like to seperate the imported category words (the long ones in my first post) with a blank space. So the "/" which disappears during import should be replaced by a blank space... Is that possible?
Hi,
The quickest way to do this, without having to write lots of filters, would be to just modify the import routine to replace "/" with " " in the category. Note that this would then affect the value that you are using in the wildcard category mapping, so these will need to be changed to include the space.
In includes/admin.php, the category is normalised (made safe) by the following code on line 172:
$record[$admin_importFeed["field_category"]] = tapestry_normalise($record[$admin_importFeed["field_category"]]);
Change this section of code as follows:
$record[$admin_importFeed["field_category"]] = str_replace("/"," ",$record[$admin_importFeed["field_category"]]);
$record[$admin_importFeed["field_category"]] = tapestry_normalise($record[$admin_importFeed["field_category"]]);
That should do the trick!
Cheers,
David.
Hello Al,
There are various ways to handle this.
Firstly though, I imagine that the categories are being inserted as all-one-word because the words are actually separated by a character that is stripped.
Is this the case, and do you know what the character is - for example, are they in the feed as something like:
drogisterij/artikelen/parfums/heren/douchegel
Can you post a couple of examples?
Cheers,
David.