View Single Post
  #20  
Old 12-12-2005, 11:25 AM
 
chyldofsun chyldofsun is offline
 

eXpert
  
Join Date: Jan 2003
Location: Sunny Southern California
Posts: 292
 

Default Re: Include search by SKU into basic search in v4

[quote="27stars"]Hi there,

v4 has some nice features and some not-finished business. Why would x-men include search by SKU/product code in advanced search when this is one of the main search fields people are looking for rpoducts in a lot of industries (auto, computers and etc? Here is the simple mod to search by sku from the main search box:

search.php

change:

Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["extra_fields"])) {

to

Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["by_productcode"]) && empty($data["extra_fields"])) {


I have version 4.0.17 and the search.php code is different. Is ther an update to this mod?

Here is my code:

#
# $Id: search.php,v 1.2.2.3 2005/01/14 12:07:30 max Exp $
#

require "./auth.php";
define("GET_ALL_CATEGORIES", true);
require $xcart_dir."/include/categories.php";

if($active_modules["Manufacturers"])
include $xcart_dir."/modules/Manufacturers/customer_manufacturers.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($active_modules['SnS_connector']) && $REQUEST_METHOD == 'POST') {
if($simple_search == 'Y') {
func_generate_sns_action("SiteSearch");
} else {
func_generate_sns_action("AdvancedSearch");
}
}

x_session_register("search_data");
$search_data["products"]["forsale"] = "Y";
include $xcart_dir."/include/search.php";

if (!empty($QUERY_STRING)) {
$location[] = array(func_get_langvar_by_name("lbl_search_results "), "");
$smarty->assign("main","search");
}
else {
$location[] = array(func_get_langvar_by_name("lbl_advanced_searc h"), "");
$smarty->assign("main","advanced_search");
}

# Assign the current location line
$smarty->assign("location", $location);

func_display("customer/home.tpl",$smarty);
?>


Thanks!
__________________
X-Cart Version 4.4.3

In the USA: 1-818-332-7931
Reply With Quote