You are here:  » Show all products (across all merchants)


Show all products (across all merchants)

Submitted by jim on Fri, 2009-02-27 18:39 in

Hi David, a simple question but I can't find the answer using the search function on the forum...

How would you show all products across all merchants?

If it wanted my front index page to be a (paginated) list of all products from every merchant (rather than the default Google-like search box + featured products as standard), how would I accomplish this?

Thanks!

Submitted by support on Fri, 2009-02-27 18:49

Hi Jim,

The query bw: will return all products; so you could make these results become your home page by replacing index.php with just:

<?php
  $_GET
["q"] = "bw:";
  require(
"search.php");
?>

For aesthetic reasons you may of course want to hide the query from the search box and header bar if $q is "bw:" so let me know if you need a hand with that...

Cheers,
David.

Submitted by shogounou on Thu, 2009-05-14 20:42

Hi david

I would like to make a image link to a search result page which show allproducts whatever the merchand.

What I have to change in my code:

<a href="/merchant/Essai/"><img src="/images/allproducts.jpg" /></a>

Thank you

Submitted by support on Fri, 2009-05-15 08:09

Hi,

Use this:

<a href="/search.php?q=bw:"><img border='0' src="/images/allproducts.jpg" /></a>

(i've added border='0' otherwise you get a border around an image when it is part of a link...)

Cheers,
David.

Submitted by shogounou on Fri, 2009-05-15 09:00

Hi David

Please accept my apologize, my previous question was not accurate enough.
When I make a link to /merchant/essai, I have a search result page with all products from the merchant essai.
I would like to create a link to a search result page showing all products from all merchants.

Best regards

Submitted by support on Fri, 2009-05-15 10:28

Hi,

Oooops - i'd missed the code tags out of my post above - you can now see the A and IMG tags required for your link to all products from all merchants...

Cheers,
David.

Submitted by shogounou on Fri, 2009-05-15 13:14

Thank you David.

Submitted by richard on Tue, 2016-05-31 22:01

Hi David,

How would I hide the query from the search box if $q is "bw"?

I'm using 1509 with search form autocomplete module.

Many thanks

Richard

Submitted by support on Wed, 2016-06-01 09:11

Hello Richard,

If $q is bw: the query shouldn't be displayed in the search box but to capture the "bw" on its own case, in html/searchform.php look for the setting of the value attribute on the text box within line 21:

value='<?php print ((isset($q) && !isset($parts[1]) && !isset($product["products"]))?$q:""); ?>'

...and REPLACE with:

value='<?php print ((isset($q) && !isset($parts[1]) && ($q<>"bw") && !isset($product["products"]))?$q:""); ?>'

Cheers,
David.
--
PriceTapestry.com

Submitted by richard on Wed, 2016-06-01 13:44

Thank you David :)