The search_header.php sidebox is specifically designed to display a search box in your Zen Cart header. Unfortunately in a default installation of Zen Cart the phrase ‘Enter search keywords here’ does not completely fit into the input field, as shown here:

There are two options to address this – either shorten the phrase to something that can be shown in full or increase the size of the input box. Step-by-step guides for both options are provided below.
Shorten the search header default phrase
- Open the header.php file located in the /includes/languages/english directory.
- Find this section of code:
// header Search Button/Box Search Button <br />define('HEADER_SEARCH_BUTTON','Search'); <br />define('HEADER_SEARCH_DEFAULT_TEXT', 'Enter search keywords here'); - and modify the define statement as needed:
// header Search Button/Box Search Button <br />define('HEADER_SEARCH_BUTTON','Search'); <br />define('HEADER_SEARCH_DEFAULT_TEXT', 'Enter keywords');** Be sure to keep the single quote marks in your new define statement.
- Save the modified english.php file to your override folder. This will be /includes/languages/english/CUSTOM/ where CUSTOM represents the name of your current template folder.

Increase the size of the search header input box
- Open the tpl_search_header.php file located in the /includes/templates/template_default/sideboxes/ directory.
- Find this section of code:
if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') { $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' ' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON); } else { $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 100px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />'; } - and modify the define statement as needed (in this example I’ve used 170px for the length):
if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') { $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 170px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' ' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON); } else { $content .= zen_draw_input_field('keyword', '', 'size="6" maxlength="30" style="width: 170px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . ' <input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 45px" />'; } - Save the modified tpl_search_header.php file to your override folder. This will be /includes/templates/CUSTOM/sideboxes where CUSTOM represents the name of your current template folder.

|
|||||||



