Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Improved Search Function

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #111  
Old 04-07-2005, 07:26 AM
 
chilll33 chilll33 is offline
 

Senior Member
  
Join Date: Oct 2003
Location: Miami, FL
Posts: 100
 

Default

I've been using this with 4.0.13 for the past couple weeks, works great, x-cart should really use this mod as their standard search.
__________________
Core version:
5.3.2.7

PHP:
5.6.29
MySQL server:
5.5.5-10.0.27-MariaDB-cll-lve  (InnoDB engine support enabled)
Web server:
Apache
Operating system:
Linux
XML parser:
found
GDLib:
found (0)
Translation driver:
Database
Curl version:
7.29.0
Reply With Quote
  #112  
Old 04-08-2005, 09:10 AM
  swordmart's Avatar 
swordmart swordmart is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 35
 

Default Search SKU's?

Hi, thx for the mod guys! I have another issue,I've been reading all over the forum, and Im stuck. Is there a way to make this mod, search the SKU without it being an option.

Cheers Jamie
__________________
X-cart 4 gold
PHP version 4.3.10
MySQL version 4.0.23-standard
Apache version 1.3.33 (Unix)
Reply With Quote
  #113  
Old 04-08-2005, 11:22 AM
 
sstillwell@aerostich.com sstillwell@aerostich.com is offline
 

eXpert
  
Join Date: Jun 2004
Location: Duluth, MN
Posts: 242
 

Default Re: Search SKU's?

Quote:
Originally Posted by swordmart
Hi, thx for the mod guys! I have another issue,I've been reading all over the forum, and Im stuck. Is there a way to make this mod, search the SKU without it being an option.

Cheers Jamie

Yes there is, try this thread.
http://forum.x-cart.com/viewtopic.php?t=11930&highlight=simple+search+sku
__________________
No longer using Xcart, was good while it lasted.
Reply With Quote
  #114  
Old 04-08-2005, 11:29 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default

After failing to modify this mod to use the newest search.php, I went back to bluecat's file, added the lines to search by sku in the above thread, and it works great on 4.0.12.

*edit* I found an error, 2 actualy.

For one, the categories no longer showed up in advanced search, and the page loaded really wide, then fit the page as it loaded (IE only). The second error I had happen before with all my pages, so I think that's probably related to some of my custom mods, probably my 4 column layout.

After taking out the search by sku code, both errors still exitst, but the only one I'm worried about is the categories not showing up.
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #115  
Old 04-08-2005, 11:35 PM
  swordmart's Avatar 
swordmart swordmart is offline
 

Advanced Member
  
Join Date: Feb 2005
Posts: 35
 

Default Thx

Thanks So much, just what i needed!
__________________
X-cart 4 gold
PHP version 4.3.10
MySQL version 4.0.23-standard
Apache version 1.3.33 (Unix)
Reply With Quote
  #116  
Old 04-09-2005, 06:16 AM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

I'm having the same problem as Alltribes, the categories are missing in the advanced search.
But the page layout is unchanged, though I'm also using 4 columns.
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
  #117  
Old 04-11-2005, 10:10 AM
  Alltribes's Avatar 
Alltribes Alltribes is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 192
 

Default

I think I have it. This includes the search by sku mod. This is for 4.0.12, but should work with later versions. I am still testing it, but the categories show up and the wierd stretching bug I had is gone

Code:
$ss = split(" ",$data["substring"]); $ss_condition = ""; foreach($ss as $s) { # Search for substring in some fields... $condition = array(); 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."%'"; } } if (!empty($data["by_productcode"])) { if($current_area == 'C' || $current_area == 'P') { $condition[] = "IF($sql_tbl[products].productcode IS NOT NULL AND $sql_tbl[products].productcode != '', $sql_tbl[products].productcode, $sql_tbl[products].productcode) LIKE '%".$s."%'"; } else { $condition[] = "$sql_tbl[products].productcode LIKE '%".$s."%'"; } } 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).")"; } $search_condition .= $ss_condition; # Search statistics

Mind you this is a mkod to the 4.0.12 code, not the code posted previously.
__________________
Alltribes.com
Native American Jewelry
Pottery, Baskets, Kachinas & More

X-cart Gold Version 4.0.17 Live
PHP 5.2.6
MySQL 4.1.25
(mt)
Reply With Quote
  #118  
Old 04-19-2005, 02:23 PM
  chetlucas's Avatar 
chetlucas chetlucas is offline
 

Advanced Member
  
Join Date: Oct 2003
Location: Inverness, Florida
Posts: 56
 

Default Search by SKU, Product or Whatever

I have looked, tried and failed on everything I have found regarding improved search functions. The only version that worked for me was in 3.5.3 and it worked well. I want the same thing in 4.0.11. I want to be able to search from the main search bar for sku, product or whatever I type in and search for. If I type in Black Cows, I want to be able to find "black cow", or cows that are black or something like that. You get the idea. Unicorns and find unicorn without having to type it in singular phrase (cow, unicorn, etc). Persons searching usually always use plural phrases. If I knew where to put the coding for truncating the plural phrases, then I would do it. I have tried various ways, but kept getting errors. I would appreciate any assistance from the experts here. Thanks.
__________________
X-Cart version 4.1.11 (Unix)
Apache version 1.3.41 (Unix)
MySQL version 5.0.67 - community
PHP version 5.2.5
PERL version 5.8.8
http://www.etekmart.com
Reply With Quote
  #119  
Old 04-20-2005, 07:05 AM
 
html_sucks html_sucks is offline
 

Advanced Member
  
Join Date: May 2004
Location: London, UK
Posts: 63
 

Default Missing categories in advanced search and products admin

I've also just noticed the missing categories in advanced search and products admin, which i've tracked down to the (much) improved search.php script (only issue i've found) - this was on v4.0.13

Quite simple to fix, just add this code to the end of the file search.php file (about line 647/648 for me)

Code:
$search_categories = $smarty->get_template_vars("allcategories"); $smarty->assign("search_categories", $search_categories);

Hope that helps
__________________
X-Cart v4.2.0, v4.0.13, v4.0.9, v4.0.17
Reply With Quote
  #120  
Old 05-13-2005, 10:37 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

This is great. The x-cart search really needs to be improved. Can someone post the final version of the include/search.php they are using for 4.0.13?
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:45 PM.

   

 
X-Cart forums © 2001-2020