modifying search
I'm tring to add a few options to the searching box that is provided. I have already made it so it will search some of the params that I have added to the product table, but this only works for searches done with the provided search box. I tried adding a drop down which would be incorporated into the seach but I'm getting this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mysite/xcart/config.php on line 293 This is how I modified the code on search.php: Code:
$search_query = "(products.product like '%$substring%' or products.descr like '%$substring%' or products.productcode like '%$substring%' or products.param05 like '%$substring%' or products.fulldesc like '%$substring%') and categories.category like '$search_category%' and products.forsale='Y' and products.param04 = '$selGenre' group by products.product"; I added the "and products.param04 = '$selGenre' " part. I am planning on adding an advanced search page but this was a first temp step. Any thoughts would be appriciated. thanks Ryan |
What version of x-cart are you using?
|
version 3.1.3
|
Well I figured out my problem and of course it was just one of those dumb mistakes. If you notice in my code above i have "products.fulldesc" but it should be "products.fulldescr". That's what you get when you change two things at once. So if anyone is interested here is how I modified the search box code (atleast the query in search.php) "selGenre" is the name of my drop down box.
Code:
if ($selGenre == 'all'){ In order for the pages beyond the first page of results you also need to change this code on search.php: Code:
$smarty->assign("navigation_script","search.php?substring=".urlencode($substring)."&in_category=$in_category&selGenre=$selGenre"); |
All times are GMT -8. The time now is 05:16 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.