You are here:  » Mapping product to category


Mapping product to category

Submitted by wesse249 on Fri, 2015-11-20 20:37 in

Hello David,

Is it possible to map products with a specific word in their title to a category?

For example i have pillows under the category mattress.

So i want all product with the word pillow are automaticly placed under the category pillows.

Thanks,

JR

Submitted by support on Mon, 2015-11-23 10:07

Hello Jan,

Sure - Product Name can be included in the code that tests for the keywords in a Category Mapping alternative entry. In includes/admin.php look for the following code at line 401:

  if (strpos($importRecord["category"],$word) !== FALSE) $found++;

...and REPLACE with:

  if (strpos($importRecord["category"].$importRecord["name"],$word) !== FALSE) $found++;

Cheers,
David.
--
PriceTapestry.com

Submitted by stevebi on Mon, 2015-11-23 10:59

Thank you JR for the question and David for the reply.

I have applied the change

Submitted by wesse249 on Tue, 2015-12-01 21:46

Hello David,

I don't understand it.

I made category under category mapping called "Afzuigunit" {link saved}

I configured the category afzuigunit and added the word MC914ZMB from the title of this product. {link saved} (i filled this in at at alternatives.

After this i imported everything. But the product is not showing up under the category afzuigunit.

Can you tell me what i'm doing wrong?

Submitted by support on Thu, 2015-12-03 11:04

Hello Jan,

Make sure the keyword is on a line on its own and not with the = (exact match) prefix so just:

MC914ZMB

If that's all in order, please could you email me your modified includes/admin.php and I'll check that out further for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by wesse249 on Mon, 2016-02-01 12:04

Hello David,

For example i have 6 products in category 1:

1 test1
2 test2
3 test3
4 test4
5 test5
6 test6

Products test1, test2 en test3 are manually mapped to category 2 by me. The other products i don't map to another category. And are staying in category 1. The products test4, test5 and test6 i want to remove and also category 1. To realize this i use drop record and type category 1. But now my problem when i drop category 1 then the manual mapped products are also removed. Do you have a solution for this? Is dropping record maybe to set as latest action? So first map the product and after that remove the category?

Thank you very much.

When i map product to a specific category

Submitted by support on Mon, 2016-02-01 12:06

Hello Jan,

I'll follow up by email with you about this, it may simply be a case of shifting the filter code so that it is applied after mappings, however if that causes more problems than it solves then there are various methods of setting up filters so that they can be executed either before or after mapping...

Cheers,
David.
--
PriceTapestry.com

Submitted by wesse249 on Sun, 2016-02-07 20:55

Hello David,

With this mod it's possible to map products to a specific category. But sometimes i map some products to a specific category an after that i map the complete category with the products left also to a new category.

When i do this the products which i have mapped are placed back in the original category which i mapped to another category. So the specific productmappings are gone.

Is here a solution for?

Thank you.

JR

Submitted by support on Mon, 2016-02-08 09:49

Hello Jan,

What will be happening is that the mapping by category is being matched first, so effectively it is overriding the mapping by name.

In this case, it would be best (if practical) to use Product Mapping to apply the category change, as Product Mapping is applied before Category Mapping.

Create Product Mapping entries with the exact name of the products as they exist, and on the configuration page simply leave the Alternatives box blank and use the Category box to set the specific category required for the product.

Alternatively, if you would prefer to continue to manage everything through Category Mapping, drop me an email with your modified includes/admin.php and it would be no problem to have the Category Mapping process make two passes, matching by product name first and then by category name so that product name matching takes priority.

Cheers,
David.
--
PriceTapestry.com