X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Improved Search Function (https://forum.x-cart.com/showthread.php?t=4415)

intel352 04-03-2006 03:14 AM

get a program like Araxis Merge or WinMerge, compare the search-related files to see what the differences are, might help you determine if there are dependency differences or not :-)

chrisollar 04-04-2006 09:47 AM

Quote:

Originally Posted by davidsaldana
This search is great, I have been using it for a couple of months now. I have noticed that some of my customers are searching for products by the SKU. I have seen other sku search modifications on the forums, but none seem to work with this 4.0.16 modified search. Does anybody know how to change this to search by sku?

Thanks



I am having problems with SKU search, too. We are running gold 4.0.18. No search using sku alone works--not even the advanced search. I tried the mods but can only find partial code in our version. Any help would be appreciated!

intel352 04-04-2006 09:50 AM

the other day was doing a code compare between 4.0.18 & 4.1 rc 4 (on include/search.php), looks like there's a piece missing from the query regarding SKU.

FYI, in case you want to work on figuring out why the SKU search isn't working.

jherzog 04-06-2006 10:16 AM

Can we create a sticky w/ the best code for current version
 
Is it possible, or does any one else think it is a good idea to create a sticky post at the begining of this thread that contains the best code for use with the current version?

It is very confusing to read all 13 pages and then try to remember on which page and post the latest code was. I have seen many people asking through out the thread what the latest code was, so I know I am not the only one. I have seen on other mod threads that the first post is sticky and updated with newest changes/code.

Just an idea.
Jed

MOC 04-21-2006 05:26 PM

Hey Guys, could someone post me a working code for Version 3.5.14?
I tried the code which should works for 3.5.3 but then im receiving the Error QUERY EMPTY while searching.

And i lost the track about the whole Codes posted in this thread!!

Quote:

INVALID SQL: 1065 : Query was empty
SQL QUERY FAILURE:


tia
saskia

VTX 05-22-2006 02:45 AM

Is it possible to extend this search code to include searches in the category fields?

Suppose this category:

Exhausts -> honda -> 2004 -> cb600

When I do a search for 'honda' I would like to show all products where honda is in the category or category path of the products to be displayed.

Is this doable?

MarkMan 05-25-2006 08:54 PM

Re: Can we create a sticky w/ the best code for current vers
 
Quote:

Originally Posted by jherzog
Is it possible, or does any one else think it is a good idea to create a sticky post at the begining of this thread that contains the best code for use with the current version?

It is very confusing to read all 13 pages and then try to remember on which page and post the latest code was. I have seen many people asking through out the thread what the latest code was, so I know I am not the only one. I have seen on other mod threads that the first post is sticky and updated with newest changes/code.

Just an idea.
Jed


Moderators, please, please do this. It would help out tremendously.

taltos1 05-30-2006 11:13 AM

Excellent post folks, but any idea on 4.0.18, I saw that 4.0.16 seems to be working (with a post from page 12 or 12) but does anyone have this up and running 4.0.18? Thanks a lot

Grant 05-30-2006 01:57 PM

Quote:

Originally Posted by taltos1
Excellent post folks, but any idea on 4.0.18, I saw that 4.0.16 seems to be working (with a post from page 12 or 12) but does anyone have this up and running 4.0.18? Thanks a lot


I'd like to know this too before trying to install this mod.

nfc5382 06-10-2006 02:58 PM

Quote:

Originally Posted by Grant
Quote:

Originally Posted by taltos1
Excellent post folks, but any idea on 4.0.18, I saw that 4.0.16 seems to be working (with a post from page 12 or 12) but does anyone have this up and running 4.0.18? Thanks a lot


I'd like to know this too before trying to install this mod.


This is for 4.0.18. It also searches the productid by default. Both admin and customers constantly search by the product id!

find:
Code:

# Search for substring in some fields...

replace with:
Code:

    # Search for substring in some fields...
   
    ## new advanced search
    $ss = split(" ",$data["substring"]);
    $ss_condition = "";
    foreach($ss as $s)
    {
      $condition = array();
      ## //new advanced search 
     
      if (!empty($data["by_title"])) {
        if($current_area == 'C' || $current_area == 'P') {
          $condition[] = "IF($sql_tbl[products_lng].product IS NOT NULL AND $sql_tbl[products_lng].product != '', $sql_tbl[products_lng].product, $sql_tbl[products].product) LIKE '%".$s."%'";
        } else {
          $condition[] = "$sql_tbl[products].product LIKE '%".$s."%'";
        }
      }
     
      if (!empty($data["by_shortdescr"])) {
        if($current_area == 'C' || $current_area == 'P') {
          $condition[] = "IF($sql_tbl[products_lng].descr IS NOT NULL AND $sql_tbl[products_lng].descr != '', $sql_tbl[products_lng].descr,  $sql_tbl[products].descr) LIKE '%".$s."%'";
        } else {
          $condition[] = "$sql_tbl[products].descr LIKE '%".$s."%'";
        }
      }
 
      if (!empty($data["by_fulldescr"])) {
        if($current_area == 'C' || $current_area == 'P') {
          $condition[] = "IF($sql_tbl[products_lng].full_descr IS NOT NULL AND $sql_tbl[products_lng].full_descr != '', $sql_tbl[products_lng].full_descr, $sql_tbl[products].fulldescr) LIKE '%".$s."%'";
        } else {
          $condition[] = "$sql_tbl[products].fulldescr LIKE '%".$s."%'";
        }
      }
     
      ## always search productid
      if($current_area == 'C' || $current_area == 'P') {         
          $condition[] = "IF($sql_tbl[products_lng].productid IS NOT NULL AND $sql_tbl[products_lng].productid != '', $sql_tbl[products_lng].productid, $sql_tbl[products].productid) LIKE '%".$s."%'";
        } else {
          $condition[] = "$sql_tbl[products].productid LIKE '%".$s."%'";
      }
      ## //always search productid
 
      if (!empty($data["extra_fields"]) && $active_modules['Extra_Fields']) {
        foreach($data["extra_fields"] as $k => $v) {
          $condition[] = "($sql_tbl[extra_field_values].value  LIKE '%".$s."%' AND $sql_tbl[extra_fields].fieldid = '$k')";
        }
        $join['extra_field_values'] = "$sql_tbl[products].productid = $sql_tbl[extra_field_values].productid";
        $join['extra_fields'] = "$sql_tbl[extra_field_values].fieldid = $sql_tbl[extra_fields].fieldid AND $sql_tbl[extra_fields].active = 'Y'";
      }
     
      if (!empty($condition)) {
        $ss_condition .= " AND (".implode(" OR ", $condition).")";
      } 
    ## new advanced search
    }
   
    $search_condition .= $ss_condition;
    ## //new advanced search

    # Search statistics
    if ($page == '0') {
      db_query("INSERT INTO $sql_tbl[stats_search] (search, date) VALUES ('$data[substring]', '".time()."')");
    }
  } # /if (!empty($data["substring"]))

#
# Search by product features
#


until:
Code:

#
# Search by product features
#



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

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