X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   search results with blank field (https://forum.x-cart.com/showthread.php?t=7765)

mixman 05-26-2004 08:37 AM

search results with blank field
 
Currently when a customer hits "search" with a blank search field, xcart will $QUERY_STRING, meaning show all products. Is it possible to take them to the search results page "No matching products found" when the search field is empty? I'm pretty sure the mod is somewhere in the search.tpl found below;

#
# $Id: search.php,v 1.44.2.5 2004/02/05 12:29:22 mclap Exp $
#

require "../smarty.php";
require "../config.php";
@include "./https.php";
require "./auth.php";
require "../include/categories.php";

$tmp=strstr($QUERY_STRING, "$XCART_SESSION_NAME=");
if (!empty($tmp))
$QUERY_STRING=ereg_replace("$XCART_SESSION_NAME=([0-9a-zA-Z]*)", "", $QUERY_STRING);

if(!empty($QUERY_STRING)) {
#
# Perform SQL search query
#

$substring = trim($substring);

B00MER 05-28-2004 05:20 AM

change:

Code:

if(!empty($QUERY_STRING)) {

to:

Code:

if(!empty($QUERY_STRING) && !substr($substring, 2)=="") {

mixman 05-28-2004 01:19 PM

That will work. It actually takes you to the advance search page. But that is actually OK.


All times are GMT -8. The time now is 04:38 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.