You are here:  » Merchant Category


Merchant Category

Submitted by JasonG on Fri, 2014-05-16 12:22 in

Hi David

Hope you are well?

I have a feed (CSV File) and the merchant category is

Animals & Pet Supplies > Pet Supplies > Dog Supplies > Dog Beds

How can I add this so that only the last 'Dog Beds' part is used to match my categories?

Thanks
Stuart

Submitted by support on Fri, 2014-05-16 13:12

Hi Stuart,

Sure - first of all you need to permit the ">" character as it is removed by normalisation by default, so to do this, edit includes/admin.php and look for the following code at line 191:

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

...and REPLACE with:

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

With that in place, you can then add a new Explode filter to this feed, and on the configuration page for the filter enter ">" (without the quotes) as the Explode Character or String, and -1 as the return index, which returns the last part after splitting on ">".

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by JasonG on Wed, 2014-05-28 10:04

HI David

Just wanted to double check something: Not all my feeds are like this so if I implement this, guessing it won't affect the other feeds?

Thanks
Stuart

Submitted by support on Wed, 2014-05-28 10:40

Hi Stuart,

No problem - the only possible side effect may be unwanted ">" characters in category names, it's unlikely it would occur when not being used as separator, but if you did come across an example it could easily be removed with a Search and Replace filter on the Category field for that feed...

Cheers,
David.
--
PriceTapestry.com

Submitted by JasonG on Mon, 2014-07-28 14:03

Hi,

I have not implemented the above yet but a variation on my original question.

Some merchants have used a different column in the CSV i.e. "specifications" and then a category structure of:

Dog > Dry Dog Food > James Wellbeloved > James Wellbeloved Adult

In this scenario it is not the last "> James Wellbeloved Adult" but the second "> Dry Dog Food " which would need to be mapped

Any suggestions on the basis that all merchants could be doing something slightly different

Thanks
Stuart

Submitted by support on Mon, 2014-07-28 14:10

Hi Stuart,

After making the above modification to permit the ">" character as part of the category, you can then use individual Explode filters against the Category field for each feed, so you can use different values of the Return Index.

For example, for a feed where you always want the _last_ value in the list use a Return Index of -1, whereas for a feed where you want the second value then use a Return Index of 1 (left to right is zero based, so the first item is 0, second item is 1 etc, and for right to left use negative numbers -1 (last), -2 (second to last) etc.)

Cheers,
David.
--
PriceTapestry.com

Submitted by JasonG on Mon, 2014-07-28 14:32

Thank you, I have tried this but not sure it has worked or I have done it incorrectly

This category only has 2 products in it
{link saved}

There is an "Explode" filter set-up and I registered the feed again as the column change form merchant_category to specifications

I can send you the admin.php file and give you access if required

I used "2" for wet dog food based on this category structure in the CSV

Dog > Wet Dog Food > Herrmann's Organic > Herrmann's Organic Menu Cans

Thanks
Stuart

Submitted by support on Mon, 2014-07-28 14:41

Hello Stuart,

My apologies, I initially described the Return Index value above - left to right is zero based, so the first item has a Return Index of 0, the second item a Return Index of 1 etc.

If still no joy, I'll check it out on the site for you...

Cheers,
David.
--
PriceTapestry.com