Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] - Search Box Anywhere


Recommended Posts

Search Box Anywhere

 

About this contribution:

This contribution will allow you to place a search box, not an InfoBox, almost anywhere on your site. There are two different types of search boxes to choose from, either a standard search box or an advanced search box with category selection. Each type uses advanced search and each has three options to choose from, a search box with a standard submit button, your site's default search image button, or no button. Code is provided for each type of search box and each option. A picture of each search box is also included with the code snippet. Installation is basically deciding on where you want to place the search box and then copy and paste the code.

 

Credits:

The code of this contribution is based on Advanced Search Header, http://www.oscommerce.com/community/contributions,2536. So why not just update that contribution? Well, the Advanced Search Header contribution contains code that will hide the search box on certain pages. I wanted the search box to appear on every page without the category selection box, and I didn't want to take that option away from Advanced Search Header. Also, Advanced Search Header contained some HTML formatting that didn't work well with my layout.

 

Support:

Please post your requests for support and installation help or your comments and suggestions to this thread.

Link to comment
Share on other sites

  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

Ihave tried this contrib, thanks btw :)

 

I used option 4, but it displays as ' BOX_ALL_CATAEGORIES' - everything below is fine..

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

Did you add

// Search Box Anywhere text
define('BOX_ALL_CATEGORIES ', 'All Categories');

to catalog/includes/languages/english.php just before the ?> at the end of the file?

Link to comment
Share on other sites

It hasnt made any difference, and when I search it just displays the Advanced Search Page..strange.

 

Oh well, thanks anyway :)

 

Pete

Link to comment
Share on other sites

Sorry, there was an extra space in the define. Use this:

// Search Box Anywhere text
define('BOX_ALL_CATEGORIES', 'All Categories');

Link to comment
Share on other sites

thx that worked :) but it still goes straight to advanced search page regardless of whether I enter a search term or not...sorry forbeing amoron :blush:

Link to comment
Share on other sites

No worries. I should have caught that myself.

 

I just rechecked the code again on both a stock install and a heavily modded site, and it's working correctly on each. Try checking the code again or installing a different option and let me know the results.

Link to comment
Share on other sites

Hi Tim,

 

I have tried the other's but it still brings up the advanced search page.

 

I have added the line to english.php which solved the display problem, and I'm adding this code to a header cell.

 

Thanks for your help BTW

<?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get"') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ALL_CATEGORIES

)))) . ' ' . '<input type="submit" name="Submit" value="Search">'; ?>

Link to comment
Share on other sites

Pete,

I'm not sure why this isn't working for you. The code is based on the Advanced Search Header contribution and I've searched the forums to see if there were any similar issues with that contrib, but I didn't find anything relevant. I rechecked both this contrib and the Advanced Search Header contrib with my heavily modded site and a stock install, and they both work with no problems. I'm sorry I don't have a solution for you at this time. If anyone else has encountered this problem or seen a forum post dealing with it, please let me know. -Tim

Link to comment
Share on other sites

Search Box Anywhere

 

About this contribution:

This contribution will allow you to place a search box, not an InfoBox, almost anywhere on your site. There are two different types of search boxes to choose from, either a standard search box or an advanced search box with category selection. Each type uses advanced search and each has three options to choose from, a search box with a standard submit button, your site's default search image button, or no button. Code is provided for each type of search box and each option. A picture of each search box is also included with the code snippet. Installation is basically deciding on where you want to place the search box and then copy and paste the code.

 

Credits:

The code of this contribution is based on Advanced Search Header, http://www.oscommerce.com/community/contributions,2536. So why not just update that contribution? Well, the Advanced Search Header contribution contains code that will hide the search box on certain pages. I wanted the search box to appear on every page without the category selection box, and I didn't want to take that option away from Advanced Search Header. Also, Advanced Search Header contained some HTML formatting that didn't work well with my layout.

 

Support:

Please post your requests for support and installation help or your comments and suggestions to this thread.

 

 

I used this just last night and was extremely pleased with the both the ease of implementation and the results. The advanced search return format is what I prefer anyways and this was exactly what I was looking for to put the search bar in the top right section of the header. I had been just working on adjusting the code used in the search infobox to do the same thing and was missing the part where I needed to echo the output (overthinking the problem)...so I went looking for an already completed contrib. Thank you so much!!!

Link to comment
Share on other sites

Thanks for the positive feedback Adam. I?m glad that you have found this contribution useful. It is comments like yours that help inspire further creativity and development. Thanks again. -Tim

Link to comment
Share on other sites

I have posted an update to Search Box Anywhere that fixes two problems with the code: (1) removed an unneeded quote and (2) added the end tag for the form. Download the new version at http://www.oscommerce.com/community/contributions,3295.

Link to comment
Share on other sites

I love this contribution. It has been hard for my customers to find the search all theway at the bottom of the categories. I just have one problem.. I have tried every thing I can think of to make the actual form box smaller. It cramps my links in the header. Is this possible?

Thanks

Link to comment
Share on other sites

I love this contribution.  It has been hard for my customers to find the search all theway at the bottom of the categories.  I just have one problem..  I have tried every thing I can think of to make the actual form box smaller.  It cramps my links in the header.  Is this possible?

Thanks

 

Great! I'm glad that you have found this contribution helpful.

 

You can easily make the search box smaller or larger. Find (BOX_WIDTH+10) in the code and change +10 to a lower or negative number for a smaller search box, and increase this number for a larger search box.

Link to comment
Share on other sites

Hi there;

I?ve installed your login box, and it worked fine! If I put the search function in header.php, when the user trys to make an Login, it I'll be redirect to the advance search!

 

Do you have any ideia why?

 

You can see it in action at: http://www.sambanabrasa.com/shop/

 

thanks

 

Jorge

 

Hi Jorge,

 

The login box contrib isn't mine; mine is the Search Box Anywhere contrib. I looked at the issue you are having and viewed the source code on your page and I can't see where the two contribs conflict. The code is not similar. I also tried to create an account, and that also takes the customer to the advanced search page.

 

Check the install code for both contribs again. If that doesn't work, try uninstalling each contrib and viewing your site with only one of the contribs installed at a time to see if you can determine the problem. I've never experienced a problem like this with the Search Box Anywhere contrib and I don't use the login box; try looking for the login box contrib support thread too.

 

Also, have you viewed your site in Firefox? It looks broken with missing images.

 

Good luck. Let me know what you discover.

 

All the best, Tim.

Link to comment
Share on other sites

Hi Rosa,

 

Search Box Anywhere is a very small and easy to install contrib. If you can cut and paste, you can install this contrib. The install instructions has an example of how to easily place a search box into the header of osCommerce and also contains a picture of each search box, so you can see what it will look like before you install it. Give it a try and let me know if you have any problems.

 

All the best,

Tim

Link to comment
Share on other sites

  • 1 month later...
Hi Rosa,

 

Search Box Anywhere is a very small and easy to install contrib. If you can cut and paste, you can install this contrib. The install instructions has an example of how to easily place a search box into the header of osCommerce and also contains a picture of each search box, so you can see what it will look like before you install it. Give it a try and let me know if you have any problems.

 

All the best,

Tim

Hi,

 

I just found your contrib, but I was wondering if I could do the following with it and most important how (don't have much knowlegde of php, so any help would be appriciated :blush: )

 

In each categorie I would like to have on top the following, and the search would only be within that categorie, could this be done?

 

I try to do this with HTMl, but because I use two language I doesn't work properly.

 

price from: $.... to:$.... categorie:Gold

 

Denice

Edited by jewelrytrends
Link to comment
Share on other sites

  • 2 weeks later...

Hi Tim,

First of thanks for this great contrib. It is very simple and its functionality is very well. I recommend this to all oscommerce users.

 

Also How about "login box anywhere" . Like your contribution, only 2 tep_field(one username secaond password) and login button. In addition to this, it can be replacement of "greet_user". So if a users log in the login fields change to "Hello Mrs Bryan etc.." I know it must be simple but i am not a programmer.

 

Regards

Utku

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
Hi Tim,

 

I have tried the other's but it still brings up the advanced search page.

 

I have added the line to english.php which solved the display problem, and I'm adding this code to a header cell.

 

Thanks for your help BTW

<?php echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get"') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => BOX_ALL_CATEGORIES

)))) . ' ' . '<input type="submit" name="Submit" value="Search">'; ?>

 

Hi i had this problem also here is the solution you need, i presume you were attempting to use the site search button and not a basic submit button

 

the code

	 echo tep_draw_form('search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get') . tep_draw_hidden_field('search_in_description','1') . tep_draw_input_field('keywords', '', 'size="10" maxlength="30" style="width: ' . (BOX_WIDTH+10) . 'px"') . ' ' . tep_image_submit('button_quick_find.gif', 'align="middle"')  . '</form>';

 

add the php openers and closers if you need

 

the problem was there was an string BOX_HEADING_ADVSEARCH after tep_image_submit this made the image link to the advanced search page and not submit the search

 

hope this helps you may want to update the contrib?

Edited by mintpeel
Link to comment
Share on other sites

Can you please tell me how to add the advanced search box like it is on this site: http://www.pisosenmalaga.com.es/

 

They also have categories, manufacturers (zonas) from price etc.

Regards, and thanks for your contribution.

 

[

 

quote name=Bigredman74' date='Jun 24 2005, 03:06 PM' post='642064]

Search Box Anywhere

 

About this contribution:

This contribution will allow you to place a search box, not an InfoBox, almost anywhere on your site. There are two different types of search boxes to choose from, either a standard search box or an advanced search box with category selection. Each type uses advanced search and each has three options to choose from, a search box with a standard submit button, your site's default search image button, or no button. Code is provided for each type of search box and each option. A picture of each search box is also included with the code snippet. Installation is basically deciding on where you want to place the search box and then copy and paste the code.

 

Credits:

The code of this contribution is based on Advanced Search Header, http://www.oscommerce.com/community/contributions,2536. So why not just update that contribution? Well, the Advanced Search Header contribution contains code that will hide the search box on certain pages. I wanted the search box to appear on every page without the category selection box, and I didn't want to take that option away from Advanced Search Header. Also, Advanced Search Header contained some HTML formatting that didn't work well with my layout.

 

Support:

Please post your requests for support and installation help or your comments and suggestions to this thread.

Link to comment
Share on other sites

Can you please tell me how to add the advanced search box like it is on this site: http://www.pisosenmalaga.com.es/

 

They also have categories, manufacturers (zonas) from price etc.

Regards, and thanks for your contribution.

 

Hi Michelle,

 

This, http://www.pisosenmalaga.com.es/, looks like the Advanced Search feature that is stock in osCommerce. It's found in advanced_search.php. It looks as though they just took code from advanced_search.php and put it on their index.php page. Give it a try and let me know how it works out for you.

 

All the best,

Tim

 

Great contrib! Thanks a bunch!

 

Hi Brett,

 

I'm glad that you found Search Box Anywhere useful and thanks for letting me know.

 

Tim

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...