View Single Post
  #27  
Old 03-09-2006, 02:55 AM
 
Sheffield_Tiger Sheffield_Tiger is offline
 

Member
  
Join Date: Mar 2006
Posts: 10
 

Default Re: Search Variants in 4.0.10 Code

Quote:
Originally Posted by manningbrothers
Can someone help - Im trying to track down the locations of these files but do not see Product.php or a directory called include...is this the name of the main directory or is it found for instance in the Customer menu?

Are you looking in the X-cart webmaster mode, or accesing your site through your ftp client?

The include directory is in the root of your x-cart installation..

so
http://www.mysite.com/include
-or-
http://www.mysite.com/store/include

depending on how and where you chose to install the X-Cart files



Quote:
Originally Posted by mffowler
This is a great mod. I just changed the code to work with 4.0.10. include/search.php now finds variants in a search. Can someone check this to see if it's correct? It does work for me:

include/search.php

find
Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["extra_fields"])) {
change to:
Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["by_productcode"]) && empty($data["extra_fields"])) {
find
Code:
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 '%".$data["substring"]."%'"; } else { $condition[] = "$sql_tbl[products].fulldescr LIKE '%".$data["substring"]."%'"; } }
change to:
Code:
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 '%".$data["substring"]."%'"; if (!empty($data["by_productcode"])){ $condition[] = "$sql_tbl[products].productcode LIKE '%".$data["substring"]."%'"; if(!empty($active_modules['Product_Options'])) { $condition[] = "$sql_tbl[variants].productcode LIKE '%".$data["substring"]."%'"; } } } else { $condition[] = "$sql_tbl[products].fulldescr LIKE '%".$data["substring"]."%'"; } }

I don't know PHP and wouldn't even call myself a developer. Just a lowly store owner who wants a "search" that works. Can anyone out there tell me if this is correct or what should be modified? It works fine for me and finds variants in a search, but it was trial and error as the original and subsequent code on this post weren't compatible w/ 4.0.10 - categories didn't show up in search (admin).

If you use this, be sure to backup - I only said it works for me, but maybe it could be checked by someone?

Thanks,

Mike

Thanks Mike. After playing around with a few of the suggested changes, and climbing the walls from frustration at the poor X-Cart search (after only using it for 2 days), this did the trick. Spot on!
__________________
Version 4.0.17
Reply With Quote