Post by pablopancho » Fri Jan 23, 2015 11:55 pm

I have installed OC 2.0.1.1 and I created a new template based on the default theme.

One of the things I changed was the location of the top search field. In the custom theme however this search field is not working properly:
- pressing Enter doesn't do anything
- clicking on search button gets me to search page but with no results and no search terms filled
- using the search form in .../index.php?route=product/search page does work as it is supposed to
- bugzilla doesn't report any problems with the page

The custom template still links to catalog/view/javascript/common.js but of course links to modified tpl and css files.
In header.tpl I just moved

Code: Select all

<?php echo $search; ?>
to a different place. File search.tpl is an exact copy of the one in default folder.

How did I mess it up? Any ideas?
On the default template everything works fine.

I will appreciate any suggestions, anything I should look into?
Last edited by pablopancho on Mon Jan 26, 2015 2:25 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Oct 08, 2014 8:03 pm

Post by opencarthow.com » Sat Jan 24, 2015 12:06 am

Could you provide your site url, so I can take a look at the problem closer?

Our free extensions:
Advanced Layout System, Display Raw Product Description in Product List, Minimum Order Amount Requirement, Add to Wish List Redirect for Anonymous Customer


User avatar
Active Member

Posts

Joined
Fri Nov 28, 2014 10:41 am


Post by pablopancho » Sat Jan 24, 2015 12:15 am

Sure, it is http://www.unitedbargains.co.uk/


EDIT:
Just in case someone is checking it out I am doing the template from the scratch so if I find the issue I will let you know...

EDIT2:
So far I noticed that if you take <?php echo $search; ?> out of <header> it stops working...

EDIT3:
So I no longer have a problem as I kept search in <header> section. However I still don't understand why it cannot be moved elsewhere.

Newbie

Posts

Joined
Wed Oct 08, 2014 8:03 pm

Post by opencarthow.com » Sun Jan 25, 2015 10:03 pm

pablopancho wrote:Sure, it is http://www.unitedbargains.co.uk/


EDIT:
Just in case someone is checking it out I am doing the template from the scratch so if I find the issue I will let you know...

EDIT2:
So far I noticed that if you take <?php echo $search; ?> out of <header> it stops working...

EDIT3:
So I no longer have a problem as I kept search in <header> section. However I still don't understand why it cannot be moved elsewhere.
Is the problem solved? I see that the search box works properly.

Our free extensions:
Advanced Layout System, Display Raw Product Description in Product List, Minimum Order Amount Requirement, Add to Wish List Redirect for Anonymous Customer


User avatar
Active Member

Posts

Joined
Fri Nov 28, 2014 10:41 am


Post by pablopancho » Mon Jan 26, 2015 2:24 am

Yes, the problem is solved although the question remains: why can't we put search bar in other places in template structure?

Anyway thanks and I hope in the future this will be more flexible.

Newbie

Posts

Joined
Wed Oct 08, 2014 8:03 pm

Post by x4er0 » Wed Feb 11, 2015 4:09 am

pablopancho wrote:Yes, the problem is solved although the question remains: why can't we put search bar in other places in template structure?

Anyway thanks and I hope in the future this will be more flexible.
For future - I had the same problem, but I found the solution, go to common.js, find the:

Code: Select all

var value = $('header input[name=\'search\']').val();
and replace with

Code: Select all

var value = $('body input[name=\'search\']').val();
Now, all works fine :)

Newbie

Posts

Joined
Thu Oct 17, 2013 6:59 am

Post by pablopancho » Sun Feb 15, 2015 11:06 pm

Thanks man, this answers my question why it works the way it does :)

Newbie

Posts

Joined
Wed Oct 08, 2014 8:03 pm

Post by RuneNL » Fri Mar 06, 2015 12:15 am

pablopancho wrote: - pressing Enter doesn't do anything
- clicking on search button gets me to search page but with no results and no search terms filled
- using the search form in .../index.php?route=product/search page does work as it is supposed to
- bugzilla doesn't report any problems with the page
I have the exact same issues, except my search has never left the header.
The problem I have is that the top search works, but on the search page it comes back empty nothing found.

Any chance you are willing to share the enter and search page solution?

Thanks

Newbie

Posts

Joined
Fri Mar 06, 2015 12:11 am

Post by chobits332 » Sun Nov 01, 2020 1:28 am

RuneNL wrote:
Fri Mar 06, 2015 12:15 am
pablopancho wrote: - pressing Enter doesn't do anything
- clicking on search button gets me to search page but with no results and no search terms filled
- using the search form in .../index.php?route=product/search page does work as it is supposed to
- bugzilla doesn't report any problems with the page
I have the exact same issues, except my search has never left the header.
The problem I have is that the top search works, but on the search page it comes back empty nothing found.

Any chance you are willing to share the enter and search page solution?

Thanks
second this, search using header search bar does not search term but goes to empty results page.

edit: this helped me fix it viewtopic.php?f=182&t=173409&hilit=move ... ad#p740225

https://cutsewcute.com/


User avatar
Newbie

Posts

Joined
Wed Oct 28, 2020 7:33 am
Location - portland
Who is online

Users browsing this forum: No registered users and 41 guests