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

Include search by SKU into basic search in v4

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-28-2004, 07:26 PM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default Include search by SKU into basic search in v4

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"])) {

after

Code:
if (!empty($data["by_fulldescr"])) $condition[] = "$sql_tbl[products].fulldescr LIKE '%".$data["substring"]."%'";

add

Code:
if (!empty($data["by_productcode"])) $condition[] = "$sql_tbl[products].productcode LIKE '%".$data["substring"]."%'";

skin1/customer/search.tpl

after

Code:
<INPUT type="hidden" name="posted_data[by_fulldescr]" value="Y">

add

Code:
<INPUT type="hidden" name="posted_data[by_productcode]" value="Y">

skin1/customer/main/search_result.tpl

after

Code:
<TD width="5"><INPUT type="checkbox" name="posted_data[by_fulldescr]"{if $search_prefilled eq "" or $search_prefilled.by_fulldescr} checked{/if}></TD><TD nowrap>{$lng.lbl_det_description}</TD>

add

Code:
<TD width="5"><INPUT type="checkbox" name="posted_data[by_productcode]"{if $search_prefilled eq "" or $search_prefilled.by_productcode} checked{/if}></TD><TD nowrap>{$lng.lbl_sku}</TD>

Enjoy
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #2  
Old 09-02-2004, 09:25 AM
 
nhraracer241 nhraracer241 is offline
 

Member
  
Join Date: Jul 2004
Posts: 25
 

Default

Anyone used this on version 3.5._?
__________________
nhraracer241
1 X-Cart Version 4.1.10
2 X-Cart version 3.5.10
PHP 4.3.5
MySQL server 4.0.20-standard
Operation system Linux
Apache Web Server
Reply With Quote
  #3  
Old 09-02-2004, 09:41 AM
  finestshops's Avatar 
finestshops finestshops is offline
 

eXpert
  
Join Date: Oct 2002
Location: Toronto, Canada
Posts: 335
 

Default

Quote:
Originally Posted by nhraracer241
Anyone used this on version 3.5._?

It's completely different in v3.5. I believe there is a solution on this forum
to do the same in v3.5.

Check: http://forum.x-cart.com/viewtopic.php?t=5971
__________________
Best regards,

Anton Pachkine
finestshops.com/x-cart
Reply With Quote
  #4  
Old 09-02-2004, 10:01 AM
 
nhraracer241 nhraracer241 is offline
 

Member
  
Join Date: Jul 2004
Posts: 25
 

Default

Thanks. I found a fix for this that Boomer had posted. Works great!
__________________
nhraracer241
1 X-Cart Version 4.1.10
2 X-Cart version 3.5.10
PHP 4.3.5
MySQL server 4.0.20-standard
Operation system Linux
Apache Web Server
Reply With Quote
  #5  
Old 11-06-2004, 08:58 PM
 
sonichart sonichart is offline
 

Newbie
  
Join Date: Nov 2004
Posts: 8
 

Default

Is it possible to have TWO boxes on the main page? Search ProdID and Search SKU ??
__________________
-phil

X-Cart Gold v4.0.12
http://www.cleaningsupplywarehouse.com
Reply With Quote
  #6  
Old 11-11-2004, 06:06 AM
 
mffowler mffowler is offline
 

X-Adept
  
Join Date: Mar 2003
Location: Melbourne, Australia
Posts: 811
 

Default

I don't seem to find search.php in /customer? It is in the root directory and /includes, but different than this example.

Can you point me in the right direction, so that SKU can come up in the search and advanced?

Thanks,

Mike
__________________
4.1.9
Reply With Quote
  #7  
Old 11-29-2004, 05:11 PM
 
QVS QVS is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 136
 

Default

thanks for the mod worked perfectly
__________________
xcart version 4.1.6
UK - Brighton

QVS ELECTRICAL SUPPLIES - http://www.qvsdirect.com

We supply a huge range of cables, electrical accessories, heating, ventilation, fire and security products, consumer units & circuit distribution, indoor and outdoor lighting, showers and water heating, tools and fixings, timer switches, sockets, switches, air conditioning, trunking, and much much more.
Reply With Quote
  #8  
Old 11-29-2004, 05:14 PM
 
QVS QVS is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 136
 

Default

Quote:
Originally Posted by mffowler
I don't seem to find search.php in /customer? It is in the root directory and /includes, but different than this example.

Can you point me in the right direction, so that SKU can come up in the search and advanced?

Thanks,

Mike

yeh use the one in includes
__________________
xcart version 4.1.6
UK - Brighton

QVS ELECTRICAL SUPPLIES - http://www.qvsdirect.com

We supply a huge range of cables, electrical accessories, heating, ventilation, fire and security products, consumer units & circuit distribution, indoor and outdoor lighting, showers and water heating, tools and fixings, timer switches, sockets, switches, air conditioning, trunking, and much much more.
Reply With Quote
  #9  
Old 12-03-2004, 09:01 AM
 
sstillwell@aerostich.com sstillwell@aerostich.com is offline
 

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

Default

This is a great mod!!!!

Xcart should take note and realize this should be standard operating procedure.

The mod does lack one thing. It will not bring up "variant skus" When using product variants, those skus don't work. No fear, I have an adjustment for the original poster.

include/search.php
After:
Code:
if (!empty($data["by_fulldescr"])) $condition[] = "$sql_tbl[products].fulldescr LIKE '%".$data["substring"]."%'";
Add:
Code:
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"]."%'"; } }

And all is peaceful in Xcart land once again
__________________
No longer using Xcart, was good while it lasted.
Reply With Quote
  #10  
Old 12-03-2004, 10:25 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default

Fantastic mod, thank you
__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 01:18 PM.

   

 
X-Cart forums © 2001-2020