Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / Kludgy Advanced Search Sidebar Implementation - Plz help with the details!

Kludgy Advanced Search Sidebar Implementation - Plz help with the details!

Locked

Started by rompalicious on 12 Feb 2009, 5:38 PM · Views: 971

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
12 Feb 2009, 5:38 PM
#1
rompalicious avatar

rompalicious

New Zenner

Join Date:
Oct 2008
Posts:
11
Plugin Contributions:
0

Kludgy Advanced Search Sidebar Implementation - Plz help with the details!

Hello!

I implemented an advanced search sidebar that sits next to returned search results to help users of my store filter information more effectively... (ex. Example at site)

It works (pretty well) but I have some small hangups that I could use some help addressing:

  1. How can I get the Categories drop-down to default to "All Categories"... right now it's stuck on the last category (Winches & Plates). In fact, it's stuck in the normal, un-modified, advanced search page too...

  2. When a search is performed using this tool, how I can I get it to hold onto the previous search vales in Keywords, Category, etc. It seems to hold onto the manufacturer (due to nothing I did) but I can't figure out the rest of them.

  3. How can I set up the "search in the descriptions box" to be checked by default?

Other than that, I am pretty happy with the performance but would welcome any additional constructive advice! (code is below).

Thanks.

<ul>
<td class="advsearch_sidebar" align="right" valign="top" width="185">
            <div class="advsheader"><font color = "#000000" size = "2"><font color="#ff0712" size="3"><center>Please use the below advanced search to return better results:</font><br /> </center></div> 
<br class="clearBoth" />
<?php echo zen_draw_form('advanced_search', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onsubmit="return check_form(this);"') . zen_hide_session_id(); ?>
<?php echo zen_draw_hidden_field('main_page', FILENAME_ADVANCED_SEARCH_RESULT); ?>
  
<?php if ($messageStack->size('search') > 0) echo $messageStack->output('search'); ?>  

<div class="advsresult"> 

<fieldset>
<legend>Key Word(s):</legend>
    <?php echo zen_draw_input_field('keyword', $sData['keyword'], 'onfocus="RemoveFormatString(this, \'' . KEYWORD_FORMAT_STRING . '\')"'); ?>   <br class="clearBoth" /><?php echo zen_draw_checkbox_field('search_in_description', '1', $sData['search_in_description'], 'id="search-in-description"'); ?><label class="checkboxLabel" for="search-in-description"><?php echo TEXT_SEARCH_IN_DESCRIPTION; ?>
</label> 
</fieldset>

<fieldset>
<legend><?php echo ENTRY_CATEGORIES; ?></legend>
 <?php echo zen_draw_pull_down_menu('categories_id', zen_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)), '0' ,'', '1'), $sData['categories_id']) ;//hideCategories  echo zen_draw_pull_down_menu('categories_id', zen_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)), '0' ,'', '1'), $sData['categories_id']); ?>
</fieldset>

<fieldset>
<legend><?php echo ENTRY_MANUFACTURERS; ?></legend>
 <?php echo zen_draw_pull_down_menu('manufacturers_id', zen_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS))), $sData['manufacturers_id']); ?>
</fieldset>


<fieldset>
<legend>Price Range:</legend>
<fieldset>
    <legend><?php echo ENTRY_PRICE_FROM; ?></legend>
    <?php echo zen_draw_input_field('pfrom', $sData['pfrom']); ?>
</fieldset>
<fieldset>
    <legend><?php echo ENTRY_PRICE_TO; ?></legend>
    <input type="text" name="pto" value="100000" />
</fieldset>
</fieldset> 

<div class="buttonRow back"><?php echo zen_image_submit(BUTTON_IMAGE_SEARCH, BUTTON_SEARCH_ALT); ?></div>

</div>
</form>
</td>
</ul>
</div>