Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to change the search Button?

How to change the search Button?

Locked

Views: 8,868

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
15 Oct 2007, 7:48 PM
#1
touchclothing avatar

touchclothing

Totally Zenned

Join Date:
Jul 2005
Location:
Brooklyn NY
Posts:
498
Plugin Contributions:
0

How to change the search Button?

I want to change the search button to something else but the button is in CSS can some one help with this or can it be done?

17 Oct 2007, 6:17 PM
#2
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: How to change the search Button?

There are 2 search boxes located in your sideboxes folder.
There is the header search and the side box search.

you did not say which search you wanted to change to an image.

If you open your tpl_header_search and locate this code

 } 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 change to this code:

} 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 . '\';"').zen_image_submit(BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON,'class="input" style="position:relative;left: 0px; bottom: 4px"');}

The button is already in your button folder.

If you need to change the side box search let me know and I will give you the code to change that one to an images as well.

12 Nov 2007, 6:07 PM
#3
erob avatar

erob

New Zenner

Join Date:
Nov 2007
Posts:
1
Plugin Contributions:
0

Re: How to change the search Button?

I'd like to change the search box button on the sidebox to a picture.
Please help!

12 Nov 2007, 7:20 PM
#4
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: How to change the search Button?

This is the complete code that you can replace the original code with

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_search.php 4142 2006-08-15 04:32:54Z drbyte $
 */
  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
  $content .= zen_draw_form('quick_find', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get');
  $content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT);
  $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();

  if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
    $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br />' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
    $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';
  } else {
    $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px" 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 . '\';"') . '<br />' .zen_image_submit(BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON,'class="input" style="position:relative;left: 5px; bottom: 4px"');
    
    
    $content .= '<br />Or try  <a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>';}

  $content .= "</form>";
  $content .= '</div>';
?>

You may need to set the position of your button and if you do in red is what needs to be changed

class="input" style="position:relative;left: 0px; bottom: 0px

29 Jul 2009, 3:41 PM
#5
darkj avatar

darkj

New Zenner

Join Date:
Jul 2009
Posts:
8
Plugin Contributions:
0

Re: How to change the search Button?

Hi, I am now almost desperate in not been able to find info on how to do the same - change the advanced search box on the sidebox to use a transparent picture like in here: http://butiche.com/ and here: http://www.impressionslast.com/. I've made the gif and on, but can't make it to show instead of the rectangular default form...
I've asked put that on the forum here: http://www.zen-cart.com/forum/showthread.php?t=133276 but to no avail still... Please help!!!