When using on site search, whenever you return to home page or category pages, search term remains in text box.
If a customer wants to create another search, the have to double click the term or backspace it out.
I think it should be cleared and revert to Keywords whenever you leave the search page.
I have inserted the following code in template/module/search.tpl to correct.
" method="post">
Brent
Brent
Code: Select all
$view->set('search', $session->get('search.search'));
Code: Select all
$view->set('search', '');
Regards, Fido-X.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
which means if your customer wanted to add a word to the search, they would have to re key it all
again.
As I don't have URL aliasing on at this time, I can't comment.
Does that mean if URL aliasing is turned on, there is no way to determine what page you are on.??
Brent
The keywords remain in the search on the search page so customers could utilise that instead of the search box up topbthirsk wrote: which means if your customer wanted to add a word to the search, they would have to re key it all
again.
I ran a "quick" test and with URL alias turned on and using the SEO contrib, it didn't work but I can't remember what didn't work means as I also need to apply Bruce's fix to get search working with the SEO contrib so I got all confusedDoes that mean if URL aliasing is turned on, there is no way to determine what page you are on.??
Fido-x's solution works with the SEO contrib
Nothing works without Bruce's fix when using the SEO contrib though Qphoria doesn't need Bruce's fix. I figured Q must be using the American version which doesn't work on Aussie PCs (kidding)
Thanks to you both
case you wish to add a word to enhance the search.
When you leave the search page, you are probably done searching for whatever widget you were looking for.
In all other pages, the search box should be cleared, not only for aesthetic purposes, but to make additional searches easier for your customers.
Right now, they have to click the text box and backspace out all the text from the last search.
Because I was doing a lot of testing with a wild card search I built, I got POed at having to backspace every time I wanted to change the terms, and I own the site.
Imagine a customer.
They just leave.
Brent
Brent
This is not so important to me as the keywords remain in the search field "on the page"bthirsk wrote: When you do a search and go to the search page, the search should remain in the text box in
case you wish to add a word to enhance the search.
So, having it cleared in the search box at the top bar is fine by me as the user can add words to the search "on the page" which is where I would look as a user. I'm not so likely to go back to the top bar search box but that's just me.
This one is important. Customers will get POed if they have to keep clearing the search box everytime they want to search something else.When you leave the search page, you are probably done searching for whatever widget you were looking for.
In all other pages, the search box should be cleared, not only for aesthetic purposes, but to make additional searches easier for your customers.
Right now, they have to click the text box and backspace out all the text from the last search.
Because I was doing a lot of testing with a wild card search I built, I got POed at having to backspace every time I wanted to change the terms, and I own the site.
Imagine a customer.
When you are on the SEARCH page, both search boxes are active and are not cleared after a search,
so you can add or change either box.
The only box that is cleared is the module box at the top of the page, and only when you leave the search page.
I have it set up this way on my site now.
Brent
Code: Select all
if ($request->get('controller') == 'search') {
$view->set('search', $session->get('search.search'));
} else {
$view->set('search', '');
}
Code: Select all
$request =& $this->locator->get('request');
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Your code follows the "true path" and works both with and without url alias turned on.
Nice idea too bthirsk, I have adopted it for my sites too.
cheers
Bruce
Thanks Bruce. Damn, now I have to open the double doors to get my head through (both of them)bruce wrote: Nice one fido-x
Your code follows the "true path" and works both with and without url alias turned on.
I agree, it is a good idea. I'll be using it myself in my own current and future projects.Nice idea too bthirsk, I have adopted it for my sites too.
Fido-X.
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
It does not cure the problem in 7.8 though.
There is a bug I have not found yet where $search in the content .tpl
and the module .tpl seem to be different.
When testing my search problem with the added amp, I would always get one more in
the module .tpl than the content .tpl.
I think there must be a call somewhere that again modifies the 'search' variable,
but I haven't found that yet.
I really need to update to 7.9.
Thanks for all the help, guys.
Brent
Brent
Code: Select all
$session->delete('search.search')
Code: Select all
if ($request->get('controller') != 'search') { $session->delete('search.search'); }
What does your backspace do exactly? On my browser, it makes me go back a page, unless i'm in the field, in which case, I can double click my mouse in the field, then hit backspace to delete the entire field. I'd be more "POed" if I wanted to refine my search and it simply wasn't there.bthirsk wrote: I got POed at having to backspace every time I wanted to change the terms
A problem well defined is a problem half solved.
I'm not convinced we need to even involve the controller in this, i'm very much of the opinion that this is a "view" user experience issue that can probably be resolved using javascript.
Either way, I don't see this as a great solution as you still have to hit backspace to delete the entry on the search page.
Perhaps a better solution would be to use some simple javascript to select all text onclick. Similar to how the browser address bars are.
Click on the url and the whole thing selects, ready for you to type over it.
As you said Qphoria, I think some kind of javascript highlight could be the way forward, much in the same way as in browsers where when you click on the address bar the whole field highlights.
This method takes out the step of treble-(not double)-clicking the mouse in the field, but you will have to hit the delete or backspace key to clear the field.
The other option is to have a "reset" button/link, that will clear the field, and set focus on the field so you can get started on it.
I'm not convinced there's an issue at all, but if there is, I don't believe the solution is in the code, but instead in the user experience of the user interface.
Target.com clears the search but clearly shows "Your search for 'blah' has resulted in"
Amazon.com works the way opencart does now. Leaves it in the box and requires you to backspace
Prestashop works the way opencart does now.
Newegg.com works the way opencart does now..
Tigerdirect.com works like target above
ecost.com works like opencart
buy.com works like opencart
ebay.com works like opencart.
Zen-Cart works the way you'd like it.
I guess at the very least we could say that it might be a configurable thing.. but seems the majority of the big ones don't have any PO'd customers.
Having said this, you only have to look at what Google and Yahoo do to understand how it should work. Thus, I really don't see an issue.
Furthermore, considering this is an open source project, I'd say this is a configurable thing should you want it enough.
My advice would be to work this into your template (view) by using javascript.
I just thought it makes things cleaner not having previous search terms
in the search box when your not on the search page anymore and
thought other people might like that.
Thanks
Brent
Brent
This means, on other sites, when you return to the home page, the search field is empty, as expected.
However, OpenCart retains the search session data until you overwrite it with another, or the session expires.
The reason the data is retained is mainly for the search pages, so that the entry can be amended, and for the pagination to work.
Thus, we probably only really need to use the session values on the search page itself.
And on the search page, there are two fields, one in the main template, and one as part of the actual search page itself. I propose we don't need to fill both, only the one as part of the search page, the other can remain default.
As a result, this solves all the issues.
Users browsing this forum: No registered users and 26 guests