You are here:  » Price comparison - multiple same prices for same product and same merchant

Support Forum



Price comparison - multiple same prices for same product and same merchant

Submitted by italiano28 on Fri, 2008-02-15 17:28 in

Hello Mister David,i have a little problem,when i click on compare price, there are in most cases a single merchant that have few same products name with same prices like here: http://www.volilowcost-per.com/compara-prezzi/product/Aberdeen.html
May i need to filter in products.php in this way : if there are 1 merchant that have more same products names,and on that name product is the same price then display just one of that products. (PS.i have no more dupe filter and i want not activate it) .
Thank you for helping in advanced and sorry again for my bad english.
Cheers
Stefano

Submitted by support on Sat, 2008-02-16 09:40

Hello Stefano,

Yes - you can do this by enforcing a "GROUP BY merchant" clause into the SQL that selects the products. In products.php, look for the following code on line 21:

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

...and change this to:

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

That should do the trick!
Cheers,
David.