Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search Box Problem


NavCopy

Recommended Posts

The Search Box that I am using also has the 'advanced search'. When I enter text in the field and hit the standard search button it only goes to the advanced search page and does not provide me with any results. That is unless I re-enter the same info on the advanced page and search from there.

 

Can anyone help? I'm not sure if this is the correct file to look into but here is the search.php file, the only part missing is the OSC info on the top:

 

<!-- search //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_SEARCH);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('form' => tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
                              'align' => 'center',
                              'text' => '
					<table cellpadding="0" cellspacing="14" border="0" class="" style="height:3px;">
						<tr><td style="width:100%;vertical-align:middle;">'. tep_draw_input_field('keywords', '', 'size="10" maxlength="30"  style="height:19px; width:100%;"') . '' . tep_hide_session_id() .  '</td>
							<td><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">'.Tep_Image_Button('go1.gif').'</a>
						</td></tr>
						<tr><td colspan="2">' . BOX_SEARCH_TEXT . '<br style="line-height:1px;"><br style="line-height:13px;"><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '"><b>' . BOX_SEARCH_ADVANCED_SEARCH . '</b></a></td></tr>
					</table>							   
					');

 new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- search_eof //-->

 

Thanks,

Nav

Link to comment
Share on other sites

Hi... I found a problem with the search box not finding any products if they weren't under a catagory? Might this be the problem?

 

As far as I know both search functions (quick and advanced) both go to the same page :)

Link to comment
Share on other sites

Matt,

 

All products are under Categories and the search function works under the advanced page. Just to make sure we are talking the same thing here I do expect both methods to ultimatly take me to the same results page. However, I expect the quick link to take me directly to the results page and the advanced link to go to the advanced page and then the results.

 

Is this not what should happen, and if so can you shed any light on why it does not do this for me?

 

Nav

 

 

 

Hi... I found a problem with the search box not finding any products if they weren't under a catagory? Might this be the problem?

 

As far as I know both search functions (quick and advanced) both go to the same page :)

Link to comment
Share on other sites

looks liek your button is POINTING to that page

 

here is what you have:

<td><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH) . '">'.Tep_Image_Button('go1.gif').'</a>

 

i think it should be this:

<td><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULTS) . '">'.Tep_Image_Button('go1.gif').'</a>

 

but i'm not sure, you can TRY that for now, i am going to look at mine to double check.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

can you post a link to your site so i can see what your box looks like?? because my code is a TAD different than yours, and my search box is untouched.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

I changed the code as suggested but nothing different happens.

 

BTW: website is still under development at novasport.ca/osc

 

 

 

 

can you post a link to your site so i can see what your box looks like?? because my code is a TAD different than yours, and my search box is untouched.
Link to comment
Share on other sites

To put it in basic methods

 

The search box is a form

 

Advanced search is the same form, but with more fields

 

both submit to advanced search results (you're right Lindsay) which builds a query that applied by product_listing.php

 

If you've changed field names or changed the form method you will get no result, why did you set the search box to point to advanced search, submitting a form to a form will never work!!

 

Put back the original search box & you should be OK.

 

NB when advanced search results builds the query it includes categories as a straight join, thats why if product is not in a category it wont appear.

 

;)

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I'm not sure I understand exactly what you are saying as I am new to this, but I should mention that this is a template and the code entered above is exactly as the original template file has it (with the exception of changing the file for the button). I have even tried to revert back to the original just to check, but still no luck.

 

Since there has been no changes to this file I suspect there was a problem from the start. Regardless I am still looking for a resolution and any additional thoughts or ideas are appreciated.

 

Nav

 

 

 

 

 

To put it in basic methods

 

The search box is a form

 

Advanced search is the same form, but with more fields

 

both submit to advanced search results (you're right Lindsay) which builds a query that applied by product_listing.php

 

If you've changed field names or changed the form method you will get no result, why did you set the search box to point to advanced search, submitting a form to a form will never work!!

 

Put back the original search box & you should be OK.

 

NB when advanced search results builds the query it includes categories as a straight join, thats why if product is not in a category it wont appear.

 

;)

Link to comment
Share on other sites

Templates are a menace if not done carefully.

 

Best talk yo your template provider, only they know what they've done. Perhaps they supplied you with duff code.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

As this is still in development I'll just move on to another section and come back to this at a later time. If all else fails I'll just remove the quick search function.

 

Nav

 

 

 

 

 

 

Templates are a menace if not done carefully.

 

Best talk yo your template provider, only they know what they've done. Perhaps they supplied you with duff code.

Link to comment
Share on other sites

You could post the code from your search box.

 

The more info you provide the better the reply.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

i agree with spooks. He talked me out of using a template and i am SOOO happy with that decision!! I really do not know much when it comes to coding, but i have been able to make some really GREAT changes (more to come) with the help of the people on here and the contributions.

 

If you see this problem now, chances are, you are going to be coming across a TON of more problems... if you havent gotten too far into it, i would personally suggest scrapping the whole thing, downloading a vanilla oscommerce, and then just reading and learning. There is a link in my sig. called ROAD MAP TO OSCOMMERCE which can help you understand the file structure, and there is a few therads in the TIPS AND TRICKS section that are REALLY helpful, including the BASICS FOR DESIGN.

 

I used that last thread A LOT and then just searched throught the images and layout section of the addons and was able to get quite a bit done, considering i can NOT create code from scratch AT ALL

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...