Is SKU a reliable field for comparison? I think every merchants has his own SKUs and using SKU for comparison will get strange and incomplete comparison. Am I right?
How reliable is comparison between "Name"? I know it is the best option available.
I only have a one men army.
I think the comparison is between the whole product name. Wouldn't the result be better if for instance only the first 50 characters would be compared? The visible name would be the same, but only the comparison would be different. Some merchants add info behind the name, like colors.
Or maybe some words are skipped in comparison like the colours and "the", etc.
Probably you know, but when using Google, words between quotes gets the exact search result.
Try
"Premier Acoustic PA 6F Home Theater System Cherry"
vs
"Premier Acoustic PA 6F Home Theater System"
How can I remove specific words from the name field? Using filter is too much work. One rule for every word for each merchant is very complicated. Can I use the rule below somehow?
$record[$admin_importFeed["field_name"]] = tapestry_normalise($record[$admin_importFeed["field_name"]]);
Hi John,
Yes - you can do as much "global filtering" as you like by modifying the code in the import handler and changing the value of $record[$admin_importFeed["field_name"]].
For example, to remove the word "Cherry" you would use the following code:
$record[$admin_importFeed["field_name"]] = str_replace("Cherry","",$record[$admin_importFeed["field_name"]]);
I would then recommend a final trim after any modifications....
$record[$admin_importFeed["field_name"]] = trim($record[$admin_importFeed["field_name"]]);
Cheers,
David.
I assume it is case sensitive and I have to use cherry and Cherry.
For "blue " it is blue + space? (I don't want to remove blue from bluetooth)
How about several words like Cherry, Pine. Seperation by space ?
Something like:
$record[$admin_importFeed["field_name"]] = str_replace("Cherry" "Pine","",$record[$admin_importFeed["field_name"]]);
Hi John,
You would have to be careful about the replacement tokens in use for that very reason. To be on the safe side it may be best to replace on " blue" and "blue " (leading space and trailing space).
As it stands, it would be case sensative, but you can use str_ireplace() as a case insensitive alternative.
To work with a list of words, you're almost right - but you need to supply the list as an array; for example:
$record[$admin_importFeed["field_name"]] = str_replace(array("Cherry", "Pine"),"",$record[$admin_importFeed["field_name"]]);
For maintenance purposes, it may be easier to layout your code as follows:
$removeWords = array();
$removeWords[] = " blue";
$removeWords[] = "blue ";
$removeWords[] = "cherry ";
$removeWords[] = " cherry";
// etc. etc.
$record[$admin_importFeed["field_name"]] = str_ireplace($removeWords,"",$record[$admin_importFeed["field_name"]]);
(that's using the case insensitive version)
Cheers,
David.
I think $removeWords[] = " blue"; removes blue from bluetooth and from blues for instance.
I think the savest way is replace " blue " for " " (one space between). This way only blue is changed and no others words are cutoff.
Would it be something like:
$record[$admin_importFeed["field_name"]] = str_replace(array(" Cherry ", " Pine ")," ",$record[$admin_importFeed["field_name"]]);
Yes - that's right. The only situation I was thinking of is when "Blue" is right on the end of the product name, e.g.
"Widget Blue"
..which would not be replaced.
What you could do, however, is to add an extra space before running your replacements so that it doesn't matter - and remember that it will get removed by the trim() at the end, if not before; for example...
$record[$admin_importFeed["field_name"]] .= " ";
$record[$admin_importFeed["field_name"]] = str_replace(array(" Cherry ", " Pine ")," ",$record[$admin_importFeed["field_name"]]);
$record[$admin_importFeed["field_name"]] = trim($record[$admin_importFeed["field_name"]]);
Cheers,
David.
Hi John,
Although comparison by name can never be 100% reliable given the way merchants name products slightly differently, it nonetheless (in my option) gives more than satisfactory results considering that it many cases there is good correlation between merchants - and even when there is not the other entries show up in search results or as related products (if you use this feature).
The "Big" price comparison sites employ small armies of people simply to match products up between merchants; and as most affiliates are not in a position to be able to do that an automated matching by product name is the best alternative. If you want to spend time matching up you can always use filters to change the names of products to common values - some users have done this (particularly on smaller, niche sites) to great effect.
Cheers,
David.