Post by madaha » Fri Sep 14, 2007 10:55 am

Current URL in address bar is always like this "http://demo.opencart.com/index.php?controller=search", no matter what keywords you search. I want to search directly from Web browse address bar, like

"http://demo.opencart.com/index.php?cont ... motorcycle[/b]"

Why I need this?  I can list all "red motorcycle" as one category by putting a link on my page "Red Motorcycle".  It will be very easy to create different categories according to keywords.

Anyone can help?

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by luvz2drv » Fri Sep 14, 2007 2:54 pm

the search uses post..  what you are listing is get..

luvz2drv


Post by madaha » Fri Sep 14, 2007 3:34 pm

Do you mean it's impossible? I really need this function !

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by nde » Fri Sep 14, 2007 5:19 pm

You could set up a form and set the input field to hidden. Then add the wanted values like below and style the submit button with css.

Code: Select all

<form action="http://localhost/opencart/index.php?controller=search&action=page" method="post">
  <input type="hidden" name="search" value="red motorcycle" type="text">
  <input value="red motorcycle" type="submit">
</form>

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by Daniel » Fri Sep 14, 2007 8:03 pm

You can rework the code to accept the vaiables from the address bar. But can not change to use a form and GET method together.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by madaha » Fri Sep 14, 2007 8:08 pm

Very good solution ! Thanks a lot !

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by madaha » Fri Sep 14, 2007 8:10 pm

Daniel wrote: You can rework the code to accept the vaiables from the address bar. But can not change to use a form and GET method together.
As I said, I know nothing about programming. It's impossible for me to rewrite the code.  Is there any one can do this work?

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by madaha » Sat Sep 15, 2007 9:06 pm

nde wrote: You could set up a form and set the input field to hidden. Then add the wanted values like below and style the submit button with css.

Code: Select all

<form action="http://localhost/opencart/index.php?controller=search&action=page" method="post">
  <input type="hidden" name="search" value="red motorcycle" type="text">
  <input value="red motorcycle" type="submit">
</form>
I just found out that this way doesn't work. You only can use one time, after you reopen the Web browser, it doesn't work any more.  The seach function on the page head doesn't work too ! Anyone can help again?

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by luvz2drv » Sat Sep 15, 2007 11:16 pm

well I would have to disagree -- my manufacture drop down uses the search and works 100%

also this search can work in the url .. I have it working on a test site... and I can toss in search strign after search string...

so ...  not sure where you got this.. but I know it can b done.


-=Luvz2drv=-

luvz2drv


Post by madaha » Sat Sep 15, 2007 11:39 pm

I checked the web page source code and found the following line added for each button by system:



The problem might be the PHPSESSID ? how to slove?

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by luvz2drv » Sun Sep 16, 2007 12:27 am

that is just showing a user logged in and there session

luvz2drv


Post by madaha » Sun Sep 16, 2007 8:10 am

-=luvz2drv=- wrote: that is just showing a user logged in and there session
Please see the non-working search function here: http://www.tianzhengrong.com ( Buttons under "click to search " on homepage )

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by luvz2drv » Sun Sep 16, 2007 8:41 am

well from that url --  all I got to say it your site is broke.. 

searching for a product on your site gets no results
start there...

then try for buttons.. --    if you look at my site you can search for "category" and have a product returned to you

start there..

then build..

luvz2drv


Post by madaha » Sun Sep 16, 2007 9:36 am

-=luvz2drv=- wrote: well from that url --  all I got to say it your site is broke.. 

searching for a product on your site gets no results
start there...

then try for buttons.. --    if you look at my site you can search for "category" and have a product returned to you

start there..

then build..
That's the default site content by Daniel. Is it broke?
Searching for a product get no result - that's the problem I'm talking about.
Your site hosting-whse.com built by Opencart?

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by luvz2drv » Sun Sep 16, 2007 10:35 am

my democart.hosting-whse.com
yes

luvz2drv


Post by madaha » Sun Sep 16, 2007 10:40 am

-=luvz2drv=- wrote: my democart.hosting-whse.com
yes
This is what you said "Luvz2drv Mod Shop"  ? It's not a search button !  It's an category link.

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by luvz2drv » Sun Sep 16, 2007 6:27 pm

wow - you must get off the cheap stuff..  controller=msearch  is a search link ..

why not try contoller=mseach in you cart url...  I know it will not work...

that is a custom  search from a drop down box  to show all product from a manufacture

I have other demo links I can send you if you like that show that working...

I have offered to make you a working mod..  you declined on price... 

but as I said .. your cart is BROKEN...  for the search doesn't work at all....  before you can go farther..  fix it..

luvz2drv


Post by nde » Sun Sep 16, 2007 8:01 pm

@ madaha

your cart installation is broken. the form code I posted above WILL NOT break your cart. that's just impossible since 3 lines of html will of course not interfere with the php. I just realized that the form on the search results page is exactly the same. look into catalog/template/default/module/search.tpl

no offense, but judging from your comment above you need to learn more about the form tag method property (post/get).

as for your other post about price range, that would require some lines of php. the second post in the thread says it all, look into catalog/controller/search.php

nde
New member

Posts

Joined
Sat Jun 30, 2007 7:32 am

Post by madaha » Sun Sep 16, 2007 8:41 pm

hi, nde, thanks for your response. Actually, my problem is that I know nothing about programming. The search function I required is my second problem.

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by madaha » Sun Sep 16, 2007 9:12 pm

I just empty the database, delete all scripts and made a clean installation with the default setting and product content from the very beginning. I didn't any single script or template. I used the base seach for "product 1". It worked.  "Product 1" appears in search result page.

I cleared the cache and reopen the web browser to do the same search. You know what happened? There was no search result for "product 1". I checked the option for "Search In Product Descriptions" and search again, still no result.

It means it's a  bug of Opencart v0.7.6.1?

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm
Who is online

Users browsing this forum: No registered users and 6 guests