| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
V4 - auto search using vars in url | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
Excellent! Just what I was looking for. I needed to show a list of all products from a link but using a specific sort field and direction:
Code:
but sort_field and sort_direction are not recognized like this normally so I added the following to include/search.php: Code:
above: Code:
now a string could be used like: Code:
if someone knows an easier way, please post. |
|||||||||
#12
|
|||||||||
|
|||||||||
Great Mod!
Add a link to your CSS file and it will match your site. |
|||||||||
#13
|
|||||||||
|
|||||||||
just what i was looking for excellent!
__________________
Groovico Used by X-carters the world over: Marketing Manager Pro Bundle For X-cart Featured Product Manager for X-cart Feed manager pro for X-cart http://www.firetanksoftware.com Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X |
|||||||||
#14
|
|||||||
|
|||||||
Hmmm, can anyone advise if they DIDN'T get this to work? My page simply freezes when I run a search.
__________________
-------------------- X-Cart Gold 4.1.11 Linux/Apache -------------------- |
|||||||
#15
|
|||||||||
|
|||||||||
Quote:
Not sure what you mean by "freezes"? If you end up with a blank page then it might be an error with your php code. |
|||||||||
#16
|
|||||||
|
|||||||
It shows the "searching products..." page, but never results in any searches. I tried both codes that were posted.
__________________
-------------------- X-Cart Gold 4.1.11 Linux/Apache -------------------- |
|||||||
#17
|
|||||||||
|
|||||||||
Quote:
Does it continually say "searching..." or does it eventually come up with a list of 0 products found? Sorry, just trying to clarify. |
|||||||||
#18
|
|||||||
|
|||||||
Np, I appreciate the help. I have to correct myself; I actually let it sit for about 3 to 4 minutes, and it finally resolved; however, it actually lists every product in our store (about 1800 items). So now I'm totally confused, lol.
__________________
-------------------- X-Cart Gold 4.1.11 Linux/Apache -------------------- |
|||||||
#19
|
|||||||
|
|||||||
Got the same thing... all products are coming up when using the $substr= as a call.
But after you've implemented php code: <?php $substr = $_GET['q']; ?> to hide the javascript - I've found that the only way to get your specific results is to use the link code: (using the words "joe schmoo" as value of an extra field) test instead of: test I don't know enough about PHP to fix this other than the link code mentioned above. The extra field is added as a hidden input on search.tpl <INPUT type="hidden" name="posted_data[extra_fields][1]" value="Y">
__________________
4.1.5 Gold |
|||||||
#20
|
|||||||||
|
|||||||||
Yes, you'd have to use a get string of "...auto_search.php?q=joe..." because "q" is the thing you use with $_GET['q'] (getting 'q').
Also, "...?q=joe&schmoo" is not a search for "joe schmoo". The "schmoo" would get pulled in as a another key, so you would end up searching for just "joe". If you want to add "joe schmoo" to your get string link then it would have to look like "...?q=joe%20schmoo". |
|||||||||
|
|||
X-Cart forums © 2001-2020
|