Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I need help incorporating a piece of code into a file


Guest

Recommended Posts

I found a great contrib called 'Add In-Stock Only Filter' and it works perfectly, but, it's designed to appear only on the advanced_search.php page.

 

I use an advanced searchbox which defaults to search in both titles and descriptions, so, I don't use the link for advanced search at all anymore. I want to incorporate that In-stock only checkbox into my actual searchbox. To see what I'm talking about, regarding the checkbox, visit my advanced_search.php page here.

 

How do I get that same field to appear in my normal searchbox? The code for my searchbox reads as this:

 

<?php
/*
 $Id: search.php,v 1.22 2003/02/10 22:31:05 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<!-- 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('advanced_search', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'),
						   'align' => 'center',
						   'text' => BOX_SEARCH_TEXT . '<br>' .  tep_draw_hidden_field('search_in_description','1') .  tep_draw_hidden_field('inc_subcat', '1', true) . tep_draw_input_field('keywords','','size="10" maxlength="30" class="searchForm" style="width: ' . (BOX_WIDTH-30) . 'px"') . '<br><br>' . tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))) . '<br>' . tep_hide_session_id() . tep_draw_hidden_field('hl',1) . '<br>' . tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH));

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

 

How do I get the following piece of code in the contrib to have the in-stock only checkbox to appear above the search button in my searchbox?

 

<tr>
			<td class="fieldKey"><?php echo HEADER_INSTOCK; ?></td>
			<td class="fieldValue"><?php echo tep_draw_checkbox_field('instock', 1, false); ?></td>
		  </tr>
		  <tr>
			<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
		  </tr>

 

I don't know how to rewrite or manipulate the code to do it myself. Please help! :)

Link to comment
Share on other sites

Well....I've been able to figure out how to get the actual checkbox to appear in the searchbox...and it works. When ticked, the search returns in-stock items only. Click Here to see it.

 

But, I still cannot figure out to insert the code for the text I want to appear next to it...In-Stock Items Only.

 

Anybody?

Link to comment
Share on other sites

Do you guys ignore me so I have to figure it out by myself?

 

Well, I did. I'm very proud. :)

 

If there is anyone trying to figure out a way to incorporate a search filter for in-stock items only, I highly recommend this contrib:

Add In-Stock Only Filter

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...