You are here:  » Customise "product not found" page and include "popular searches" links


Customise "product not found" page and include "popular searches" links

Submitted by kevquinlan on Tue, 2006-10-31 18:56 in

Hi everyone
hopfully an easy one. i have a lot of links that are on google etc. - however as you all know the merchants arent very consistent with naming products between feeds.
Therefore i get a lot of people ending up clicking on a google link and getting "product not found"
What is the best way to get something along the lines of "product not found" however check out these relevant searches etc....
then use this to pull up things with similar names from the database - maybe 5 random products?

possibly along the same theme - offer people a list of "popular searches" etc similar to froogles "A few of the items recently found with Froogle" table
not sure if this could be based on the top 10 or so products by click count etc? - no pictures just a text link with the product name?

any help / advice always appreciated

Cheers
Kev

Submitted by support on Wed, 2006-11-01 08:16

Hi Kev,

What some users do is add code to redirect to the search page for the product name (which is in the $q variable). This often finds the product if the name has changed etc. In products.php look for the following line:

  $banner["h2"] .= "(".translate("product not found").")";

To perform the redirect, replace this with:

  header("Location: ".$config_baseHREF."search.php?q=".urlencode($q));
  exit();

Even if it doesn't find the exact product, that should find the most closely related.

Cheers,
David.

Submitted by kevquinlan on Wed, 2006-11-01 15:09

Yes thats got it.
I currently use a Boolean "and" search on the MySql - after spotting it in a forum node.
if a word is not present in the search above then is it possible to do a "like" type of search?

i.e. link was in google for "tomtom navigator 12345"
this model is changed to a "tomtom navigator 123456"
following the above guidance it wouldnt pick up the replacement model.

Do i change back to the basic search on MySQL or can i do a "like" if no results come up

Sorry if none of this makes sense!!!

Submitted by support on Wed, 2006-11-01 17:31

Hi Kev,

I think I understand that.. it may involve sending another parameter through to search.php in order to inform it not to use the boolean search.

Your redirect code would have to be:

  header("Location: ".$config_baseHREF."search.php?q=".urlencode($q)."&nobool=true");
  exit();

Then, in search.php look for the line where you made the SQL modification, and do something like this:

  if ($_GET["nobool"])
  {
    $sql = _ORIGINAL SQL HERE_
  }
  else
  {
    $sql = _BOOLEAN MODE SQL HERE_
  }

Hope this helps,
Cheers,
David.