View Single Post
  #51  
Old 03-04-2004, 11:04 PM
 
jordan0 jordan0 is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: San Francisco, CA
Posts: 77
 

Default

Thanks funkydunk! this version of the modified search.php works great with my 3.5.4 install.
I am trying, though, to integrate a param field search function that is seperate from the substring search. I have gotten it to work great, with the exception of the navigation code. This is one of the chunks I inserted to perform a search within param01:
Code:
#Param01 Search $conp = ""; $andp = "AND"; if(!empty($search_param_01)){ $smarty->assign("stay_in_param01","$search_param_01"); $ssp = split(" ",$search_param_01); foreach($ssp as $sp) $conp[] = "(".$sql_tbl[products].".param01 like '%".$sp."%'"." OR ". $sql_tbl[products].".param01 like '%".$sp."%'".")"; } if(empty($andp))$andp = "OR"; $param01_query = (!empty($conp)) ? " AND (".join(" ".$andp." ",$conp).") " :"";

That part seems to work fine. I then made additions to my search query:
Code:
$search_query = "$category_condition and $sql_tbl[categories].avail='Y' and $sql_tbl[products].forsale='Y' $price_condition $param01_query $param02_query $param03_query $substring_query ";

And then, I think I've got something wrong here with my navigation code because it creates strange links between result pages. For example, if i perform a param01 search it returns the first page of results just fine. Then when I go to page two of the results, it forgets the param01 query and puts a "+" into the substring query. Here is the navigation code in question:
Code:
$smarty->assign("navigation_script","search.php?substring=".urlencode($substring)."&in_category=$in_category"." &search_param01=".urlencode($search_param01)."&search_param02=".urlencode($search_param02)." &search_param03=".urlencode($search_param03).$price_substring);

thanks!
__________________
Jordan Sitkin
http://www.kitkraft.biz
X-Cart 4.0.18 [unix]
Reply With Quote