You are here:  » Product Mapping Helper - Product Search

Support Forum



Product Mapping Helper - Product Search

Submitted by mennov on Mon, 2013-02-25 16:22 in

Hi,

I got some feeds where the name field for products with different weights is the same. It's for dogfood: i.e.

For Pedigree Junior 2k, 4kg and 8kg, the NAME is always: Pedigree Junior

In the DESCRIPTION field, or an additional field the weight is mentioned.

I use the Product Mapping Helper to Map the products of different feeds, but I can only search the NAME field, so there is no way of knowing if "Pedigree Junior" is the 2, 4 or 8 kg.

Is there anyway to broaden the search in the Product Mapping Helper? So that I can also search in additional fields?

Thanks,
Menno

Submitted by support on Mon, 2013-02-25 16:43

Hello Menno,

The Product Mapping Helper tool can easily be made to include `description` in its logical AND search. In admin/productsmap_helper.php, look for the following code at line 58:

      $wheres[] = "name LIKE '%".database_safe($word)."%'";

...and REPLACE with:

      $wheres[] = "CONCAT(name,' ',description) LIKE '%".database_safe($word)."%'";

However, bear in mind that Product Mapping itself applies only to the Product Name field, so the default behaviour would be that only one instance of "Pedigree Junior" per merchant is imported, regardless of the weight if it is only resolved within the description field; so if the above doesn't fix the issue for you let me know - I have written code for other filters such as seeking a value in one field to update another that might work here...

Cheers,
David.
--
PriceTapestry.com

Submitted by mennov on Mon, 2013-02-25 17:10

Hi David,

thanks for this. Indeed only one instance of "Pedigree Junior" per merchant is imported.

In the feeds there is also a unique "ID". Would it be possible to make the NAME field a combination of the NAME+ID, so that all instances are unique?

Menno

Submitted by support on Mon, 2013-02-25 17:46

Hi Menno,

Sure! The existing "Text After" filter with placeholders will let you do this - for the feed that has a unique ID, from Feed Registration Step 2, make a note of the exact field name of the ID field.

Then, from Admin home page, click Filters alongside the feed, and add a new Text After filter to the Product Name field. In the ext box on the configuration page for the filter, enter

" %ID_FIELD%"

...where ID_FIELD is the exact field name noted from Feed Registration Step 2, without the quotes, but notice the SPACE at the front - which is important otherwise there would be no space between the product name and ID in the resulting field name!

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by mennov on Mon, 2013-02-25 19:19

Hi David,

thanks, this will work!

Menno