You are here:  » search box for indivdual merchant

Support Forum



search box for indivdual merchant

Submitted by wilkins on Thu, 2006-11-30 14:27 in

hi

Has anybody done a search box for a individual merchant. Seen the topics for drop down boxes, but aqll I want is a simple search box for a merchant

Thanks

Brent

Submitted by support on Thu, 2006-11-30 15:15

Hi Brent,

The easiest way to do this is to create a form that contains the merchant name as a hidden field, and then use a snippet of code at the top of search.php that redirects the page to the appropriate "merchant:Merchant Name:Keywords" query.

Here's the search form:

<form method='get' action='search.php'>
<input type='text' name='q' />
<input type='hidden' name='merchant' value='Merchant Name' />
<input type='submit' value='Search Merchant Name' />
</form>

And then almost at the very top of search.php, but after require("includes/common.php"); - add this code:

  if ($_GET["merchant"])
  {
    $url = $config_baseHREF."search.php?q=merchant:".$_GET["merchant"].":".$_GET["q"];
    header("Location: ".$url);
    exit();
  }

Hope this helps!
Cheers,
David.

Submitted by wilkins on Thu, 2006-11-30 16:12

Hi David

thanks for the quick response, works great as always

brent

Submitted by Bigmac on Fri, 2011-06-10 13:57

Hi David,

Is it possible to have a merchant search box on a Wordpress page with 12/10A?

I have tried the solution in this thread and it doesn't seem to work.

Many thanks.

Cheers,

Hamish

Submitted by support on Fri, 2011-06-10 14:42

Hi Hamish,

The above should work fine but make sure that the action attribute of the opening form tag points to the Price Tapestry installation, e.g.

<form method='get' action='/shopping/search.php'>

(if Price Tapestry is installed in /shopping/ for example)

Cheers,
David.
--
PriceTapestry.com