Morning David
Is it possible to show only results from a single specified) merchant on the index page rather than featured products. I have had a go but don't seem to be getting the sql query right.
Chris
David
Thanks but how would I write the query if I wanted to show the first ten products of a merchants feed in the order provided by them in the feed without them being random.
Chris
Hi Chris,
They should always import with consecutive ID values, so this should do the trick:
$sql = "SELECT name,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE merchant='Some Merchant' ORDER BY id LIMIT 10";
Cheers,
David.
Thanks David
I was almost there just could not figure out "ORDER BY id"
Worked a treat.
Chris
Hi Chris,
Sure - on the following page you'll find the code for showing random products instead of featured products...
http://www.pricetapestry.com/node/2276
To have those random products selected from a single merchant, use the following replacement SQL instead of that shown in the above thread...
$sql = "SELECT name,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE merchant='Some Merchant' ORDER BY RAND() LIMIT 3";
Cheers,
David.