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

Searching Extra Fields

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-29-2003, 08:16 PM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default Searching Extra Fields

Now I need to add to the Advanced search page - I will have a drop down box with a list of values that may be found in ANY of the extra fields. So, I want to add the value selected to the advanced search.

The problem is that I think the values assigned in the <Select> drop down list need to be passed through smarty (?) somehow and then I would add this to the query:


Code:
$search_ef_condition = " AND ($sql_tbl[products].param01 like '%$ef_search%' or $sql_tbl[products].param02 like '%$ef_search%' or $sql_tbl[products].param03 like '%$ef_search%' or $sql_tbl[products].param04 like '%$ef_search%' or $sql_tbl[products].param05 like '%$ef_search%' or $sql_tbl[products].param06 like '%$ef_search%' or $sql_tbl[products].param07 like '%$ef_search%' or $sql_tbl[products].param08 like '%$ef_search%') "

(Note: I am skipping param00 and param09 intentionally)
$ef_search would be the value of what was selected in the drop-down, but HOW do I get it to pick up the value from the <select> box?? The drop down looks something like this:
Code:
<select class="combobox" name="ef_search" size="1"> <option value=""> </option> <option value="choice1">choice1</option> <option value="choice2">choice2</option> <option value="choice3">choice3</option> <option value="choice4">choice4</option> <option value="choice5">choice5</option> </select>
There's actually 15 or 20 choices in the drop down and they are hardcoded in there and they won't change.

And I modified the $search_query to include the $search_ef_condition:
Code:
$search_query = "($sql_tbl[products].product like '%$substring%' or $sql_tbl[products].descr like '%$substring%') and $sql_tbl[categories].category like '$search_category%' and $sql_tbl[products].forsale='Y' and $sql_tbl[categories].avail='Y' $search_ef_condition $price_condition ";

It's looking like I'm in over my head, but I feel I am close. Any ideas? Am I going about this the wrong way? You see what I am wanting to add to the query - Search all of the param0x fields for a value that was selected from the drop down added to the advanced search page.

Help?
Reply With Quote
  #2  
Old 04-30-2003, 08:23 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Print the complete query string and give it a whirl in phpMyAdmin to see if you've got any syntax errors or if you need to restructure the query.

hth.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 04-30-2003, 08:35 AM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

To do that, I would have to translate the variables first and this is exactly the problem - the $ef_search is not getting set by the drop down value. I believe it has to go through smarty because the other variables in the advanced search page have this: value="{$smarty.get.substring}"

I don't know enough to be able to pass the value selected in the drop down, through smarty (if that's what I need) and then to the search.php script, so the $ef_search variable contains the value selected in the drop down.
Reply With Quote
  #4  
Old 07-03-2003, 09:24 PM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Any progress?

Any progress?

It would be realy nice if the search could search feilds that are in the extra feilds.

Thanks, John7
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


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 09:45 AM.

   

 
X-Cart forums © 2001-2020