You are here:  » Spaces


Spaces

Submitted by philstone on Tue, 2006-04-04 13:15 in

Hi Dave

Was wondering if there is anyway to solve a wee issue.

on my site there is a

Sony-KDLV26A12U.html and a Sony-KDL-V26A12U.html, this is just one of many products like this, is there a simple method other than filtering each product to make both these products compare on the same page as it is only a space that is the difference between them.

Regards

phil

Submitted by support on Tue, 2006-04-04 13:22

Hi Phil,

There is an easy way to do this for the product page (where the list of prices is displayed), but to get them to match up in the search results whilst using full text indexing method would require filtering.

The method is to change to the SQL that selects products with the same name from the database from using the "name" field, to using "search_name". Currently, in products.php you have this on line 12:

$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($q)."' ORDER BY price LIMIT ".$config_resultsPerPage;

Change that to:

$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE search_name = '".database_safe($q)."' ORDER BY price LIMIT ".$config_resultsPerPage;

...and you should pull in all products with the same characters disregarding SPACE in the product name, which is what the search_name field contains.

This is the field that is used on searches less than 4 characters long (where the full text index cannot be used).