You are here:  » Show results from single merchant

Support Forum



Show results from single merchant

Submitted by chrisst1 on Wed, 2008-11-26 10:04 in

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

Submitted by support on Wed, 2008-11-26 11:10

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.

Submitted by chrisst1 on Wed, 2008-11-26 11:39

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

Submitted by support on Wed, 2008-11-26 14:20

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.

Submitted by chrisst1 on Wed, 2008-11-26 14:38

Thanks David

I was almost there just could not figure out "ORDER BY id"

Worked a treat.

Chris