You are here:  » Message while searching


Message while searching

Submitted by IG on Sat, 2012-04-21 09:25 in

Dear David

Sometimes it takes a while until the search results show up. How can I show a message like "Please be patient, we are searching for you" during the search process?

I know you have posted a solution a few months back either in this forum or at the price tapestry stand alone forum, but I simply can't find the posting.

Looking forward to your answer.

IG

Submitted by support on Sun, 2012-04-22 14:44

Hello IG,

I assume you wish to do this within the plugin, however the technique is the same - to make the search form submit to a "holding page" that displays your Please wait... message which itself uses an HTTP meta refresh header to re-submit to the search page.

To make the holding page, create a file called "searching.php" containing something like:

<html>
<head>
  <title>Searching...</title>
  <meta http-equiv='refresh' content='0;url=/shopping?pto_q=<?php print urlencode($_GET["pto_q"]); ?>' />
</head>
<body>
  <center>
  Please be patient, we are searching for you...
  </center>
</body>
</html>

(where /shopping is your containing permalink as per the configuration in wp-admin > Settings > PriceTapestry.org)

Finally, to change the search form to submit to the holding page, look for the following code at line 25 of pto_search.php:

$html = str_replace("%ACTION%",get_bloginfo('url').$pto_config_permalink,$html);

...and REPLACE with:

$html = str_replace("%ACTION%","/searching.php",$html);

Hope this helps!

Cheers,
David.
--
PriceTapestry.com