Results 1 to 10 of 20

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    In your template/sideboxes/tpl_search.php

    around line 22 put this code in starting with <input type

    <input type="image" name="search" src="includes/templates/your-template/buttons/english/button_search.gif"/>

    Believe me when I say it took me hours to figure this one out for myself.

  2. #2
    Join Date
    Aug 2005
    Location
    Philadelphia, PA, USA
    Posts
    33
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    Well I'm glad you identified the same section of problem code.

    In v1.3.6 the default code looks like
    PHP Code:
    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
        
    $content .= zen_draw_input_field('keyword''''size="6" maxlength="30" style="width: 175px" 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 '\';"') . '&nbsp; ' zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
      } else {
        
    $content .= zen_draw_input_field('keyword''''size="6" maxlength="30" style="width: 175px" 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 '\';"') . '&nbsp;<input type="submit" value="' HEADER_SEARCH_BUTTON '" style="width: 45px" />';
      } 
    I don't think this section of code was really completed. It basically says to input the graphical buttons when css buttons are enabled (via the admin panel)... but to use a standard 'submit' button when not using css.

    A bit backwards don't ya think?

    When you add the graphical image into the mix...

    PHP Code:
    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') {
        
    $content .= zen_draw_input_field('keyword''''size="6" maxlength="30" style="width: 175px" 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 '\';"') . '&nbsp; ' zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
      } else {
        
    $content .= zen_draw_input_field('keyword''''size="6" maxlength="30" style="width: 175px" 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 '\';"') . '&nbsp;' zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON);
      } 
    ... the image appears (as to be expected), but its placement is a bit whacked. I haven't figured out the right css tweaks to fix it.

  3. #3
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    Ya, My button is centered but rides a little high. I have gone on for now and will address that later. If you come up with the solution, could you pass it along?

  4. #4
    Join Date
    Aug 2005
    Location
    Philadelphia, PA, USA
    Posts
    33
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    I've moved on for the time being as well. The issue is way too cosmetic to kill hours with for now.

    I'm going to spend some time trying to merge a few posted modules: RMAs (I'll have to create this part), shipment tracking, and product management. I figure this is a bit more important and will keep me quite occupied.

    I will certainly post a solution when [if] I find it.

  5. #5
    Join Date
    Sep 2006
    Posts
    542
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    Thanks, I spent 4 hours getting the image button to get placed and then get the right link up and once I saw it on the page, well I moved on.............. There is always time later.

  6. #6
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Customized Search button does not appear

    Quote Originally Posted by refriend View Post
    I've moved on for the time being as well. The issue is way too cosmetic to kill hours with for now.

    I'm going to spend some time trying to merge a few posted modules: RMAs (I'll have to create this part), shipment tracking, and product management. I figure this is a bit more important and will keep me quite occupied.

    I will certainly post a solution when [if] I find it.
    A return authorization contribution should be available in the downloads section by the end of the week.

  7. #7
    Join Date
    Mar 2005
    Location
    Tempe, AZ
    Posts
    324
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    FYi here is the correct code, In IE and firefox my button seems pretty centered... with this code.
    Code:
    <?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"') .'<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>';
      }
    
      $content .= "</form>";
      $content .= '</div>';
    ?>
    Lextechs.com Powered By ZenCart

  8. #8
    Join Date
    Aug 2005
    Location
    Philadelphia, PA, USA
    Posts
    33
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    Hey thanks for code, but no luck...

    I think vBulletin added a space to your code on upload.You've got an extra space in 'FILENAME_ADVANCE D_SEARCH_RESULT' (mentioned for anyone trying this at home).

    All said and done... this still doesn't align the search field with the image. The BR's just feed a line; and with them removed I'm back to my original results.

    The following code seems to do the trick. (Note: This applies to v.1.3.6.) The solution lies in 'html_output.php' with the 'zen_image_submit' command.

    We need to add alignment to the submit button:

    1. Add to your stylesheet.
    PHP Code:
    .zen_image_submit_align{
        
    vertical-align:middle;

    2. Replace in html_output.php (we're really only adding class="zen_image_submit_align"):
    PHP Code:
      function zen_image_submit($image$alt ''$parameters ''$sec_class '') {
        global 
    $template$current_page_base$zco_notifier;
        if (
    strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image$alt'submit'$sec_class /*, $parameters = ''*/ );
        
    $zco_notifier->notify('PAGE_OUTPUT_IMAGE_SUBMIT');

        
    $image_submit '<input type="image" src="' zen_output_string($template->get_template_dir($imageDIR_WS_TEMPLATE$current_page_base'buttons/' $_SESSION['language'] . '/') . $image) . '" alt="' zen_output_string($alt) . '"';

        if (
    zen_not_null($alt)) $image_submit .= ' title=" ' zen_output_string($alt) . ' "';

        if (
    zen_not_null($parameters)) $image_submit .= ' ' $parameters;

        
    $image_submit .= ' />';

        return 
    $image_submit;
      } 
    with
    PHP Code:
    function zen_image_submit($image$alt ''$parameters ''$sec_class '') {
        global 
    $template$current_page_base$zco_notifier;
        if (
    strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image$alt'submit'$sec_class /*, $parameters = ''*/ );
        
    $zco_notifier->notify('PAGE_OUTPUT_IMAGE_SUBMIT');

        
    $image_submit '<input type="image" src="' zen_output_string($template->get_template_dir($imageDIR_WS_TEMPLATE$current_page_base'buttons/' $_SESSION['language'] . '/') . $image) . '" alt="' zen_output_string($alt) . '"';

        if (
    zen_not_null($alt)) $image_submit .= ' title=" ' zen_output_string($alt) . ' "';

        if (
    zen_not_null($parameters)) $image_submit .= ' ' $parameters;

        
    $image_submit .= ' class="zen_image_submit_align"/>';

        return 
    $image_submit;
      } 
    It doesn't appear to have any adverse effects on other forms. Let me know what you think!

  9. #9
    Join Date
    Aug 2008
    Posts
    7
    Plugin Contributions
    0

    Default Re: Customized Search button does not appear

    Quote Originally Posted by usernamenone View Post
    In your template/sideboxes/tpl_search.php

    around line 22 put this code in starting with <input type

    <input type="image" name="search" src="includes/templates/your-template/buttons/english/button_search.gif"/>

    Believe me when I say it took me hours to figure this one out for myself.
    Just bumping this thread as I am all kinds of confused.

    The above method seems the easiest but it also seems that there are many other solutions mentioned in this thread. I'm 100% confused on how to simply add a different search button.

    This shouldn't be so hard, should it? If anyone could possible sum-up what actually works I'd be much obliged. I've already spent way too much time trying to make this work. Thanks, all!

 

 

Similar Threads

  1. Replies: 18
    Last Post: 24 Oct 2010, 02:56 PM
  2. Advanced Search does not appear
    By Spen in forum Basic Configuration
    Replies: 1
    Last Post: 26 Sep 2008, 06:50 PM
  3. Paypal express button does not appear
    By toritaiyo in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 17 Nov 2007, 01:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg