Page 10 of 16 FirstFirst ... 89101112 ... LastLast
Results 91 to 100 of 159
  1. #91
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: CSS buttons v2.x

    Quote Originally Posted by paulm View Post
    Maybe you have made changes to the template or module that generates the listing, and replaced the original Zen Cart code that calls the zen button function by something else? (the css buttons add on uses the zen button functions to replace the image buttons by css buttons)
    Paulm, what template or modules generate the listing? I do not think that I have made any changes, but of course that is to be seen. ;-)

    Sawhorse

  2. #92
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: CSS buttons v2.x

    [FONT=Arial]Paulm, I believe I have found the source of the problem.[/FONT]

    [FONT=Arial]Please go to includes/function/html_output.php[/FONT]

    [FONT=Arial]Using the original html_output.php file the css button Buy Now is visible and works.[/FONT]
    [FONT=Arial]
    Original code - about line 293[/FONT][FONT=Arial]
    Code:
     if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') return zenCssButton($image, $alt, 'button', $sec_class, $parameters = '');
    [/FONT]

    [FONT=Arial]However, if that code is replaced with the new suggested code found in readme.txt for CSS buttons version 2.6, page 2 - Step 3, [/FONT] [FONT=Arial]the CSS Buy Now button is not visible.[/FONT]

    [FONT=Arial]Suggested replacement[/FONT] code
    Code:
    [FONT=Arial]    // bof css buttons (button)[/FONT]
      [FONT=Arial]    if (css_button_allowed($image) === TRUE) return css_button($image, $alt, 'button', $parameters);[/FONT]
      [FONT=Arial]    // eof css buttons[/FONT]
    [FONT=Arial]Now that we know where the problem is the question becomes, how to fix it?

    Sawhorse

    [/FONT]

  3. #93
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS buttons v2.x

    It's probably 2.6.4 (the first part of the readme of 2.6.4 has not been updated since 2.6)

    The install procedure, including step 3, is correct though.

    Maybe you enabled "Automaticly load image buttons if found" in your CSS Buttons settings? Then existing image buttons (in your template buttons/ folder) will override the css buttons.

  4. #94
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: CSS buttons v2.x

    Quote Originally Posted by paulm View Post
    It's probably 2.6.4 (the first part of the readme of 2.6.4 has not been updated since 2.6)

    1. What needs to be updated in version 2.6.4 readme file?
    2. If I followed the current readme procedure and used the 2.6.4 version of CSS buttons, could that have an effect on how CSS buttons work?

    Quote Originally Posted by paulm View Post
    Maybe you enabled "Automaticly load image buttons if found" in your CSS Buttons settings? Then existing image buttons (in your template buttons/ folder) will override the css buttons.
    No, I have not set in admin the ability to automatically load image buttons. Note that you see text "Buy Now" and not an image of the "Buy Now" button.

    Sawhorse

  5. #95
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS buttons v2.x

    Quote Originally Posted by Sawhorse View Post
    What needs to be updated in version 2.6.4 readme file?
    Only the part that says it's version 2.6 and that it's for Zen Cart 1.3.6. It should say version 2.6.4 and that it's compatible with ZenCart versions up to 1.3.8.

    If I followed the current readme procedure and used the 2.6.4 version of CSS buttons, could that have an effect on how CSS buttons work?
    Nope, all the instructions are correct.

  6. #96
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: CSS buttons v2.x

    [FONT=Arial]So, we now can say the the instruction in the readme.txt is functionally correct for version 2.6.4

    We have also established that I have not set in admin the ability to automatically load image buttons.

    However, when [/FONT] [FONT=Arial]the [/FONT][FONT=Arial]original code in [/FONT][FONT=Arial]includes/function/html_output.php [/FONT][FONT=Arial]at about line 293 is [/FONT][FONT=Arial]replaced with the new suggested code found in readme.txt for CSS buttons version 2.6.4, page 2 - Step 3, [/FONT] [FONT=Arial]the CSS Buy Now button is not visible.

    [/FONT] [FONT=Arial]Thus, the question remains- how do we correct?

    Sawhorse

    [/FONT]

  7. #97
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS buttons v2.x

    Hi Sawhorse,

    I finally found the cause of the problem!

    In older versions of Zen Cart none of the buttons had a css class. But in one of the 1.3.x versions, silently it seems, a class has been added to the product listing buy now button. This class is not added to the button on a default install, but it appears to depend on some admin setting(s)....

    And that class is the "listingBuyNowButton" class that we see on your product listing buy now button.

    This class overrides the css button class because the css button code prevents the class parameter to be defined twice (which would make the code invalid). That is why the button does not work as a css button under the given circumstances.

    It has been a long and frustrating search but, once I found the exact cause of the problem, the solution was quite easy to find

    In includes/functions/extra_functions/css_buttons.php find:
    Code:
      if (strpos($parameters, 'class="') === FALSE){
      // only add class if no class is passed through $parameters
        $class = ' class="' . $mouse_out_class . '" ' . $css_button_js;
      }
    And replace with:
    Code:
      if (!(strpos($parameters, 'class="') === FALSE)){
        // if $parameters contains a class definition add the css buttons class to it
        $parameters = str_replace('class="', 'class="' . $mouse_out_class . ' ', $parameters);
        $parameters .= ' ' . $css_button_js;
        $class = '';
      }else{
        // no class found in $parameters
        $class = ' class="' . $mouse_out_class . '" ' . $css_button_js;
      }

    (The reason that this problem does not occur when using the default Zen Cart css buttons is because the Zen Cart css buttons code clears all button parameters. But that is a bad solution as it invokes some other nasty bugs.)

  8. #98
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: CSS buttons v2.x

    Paulm,
    It works great

    Now I know its easy for you to say
    Quote Originally Posted by paulm View Post
    ...once I found the exact cause of the problem, the solution was quite easy to find
    but I would never have found the problem, let alone be able to fix it. Fantastic work!!!

    You know you need to make this fix available on the download as version 2.6.5 (with the minor text readme fix).

    Sawhorse

  9. #99
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: CSS buttons v2.x

    Glad to hear that it fixed the issue

    Quote Originally Posted by Sawhorse View Post
    You know you need to make this fix available on the download as version 2.6.5 (with the minor text readme fix).
    Yes, I will directly add it to my ever growing todo list

  10. #100
    Join Date
    Oct 2007
    Location
    Kentucky - USA
    Posts
    428
    Plugin Contributions
    0

    Default Re: CSS buttons v2.x

    I meant that in the most charitable, non demanding manner. You have spent a great deal of time adding a lot of great mods for ZC.

    But, I do know what you mean. The more you do the farther behind you get. Maybe there is a fortune cookie message in that statement for the both of us.

    Again thanks.

    Sawhorse

 

 
Page 10 of 16 FirstFirst ... 89101112 ... LastLast

Similar Threads

  1. v151 Disable CSS buttons for some buttons and not others
    By longstockings in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 16 Nov 2013, 04:00 PM
  2. Help with using css buttons, "update cart' does not use the css buttons?
    By trinitypres in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Jan 2011, 04:34 PM
  3. CSS buttons not fully working for some buttons in my shopping_cart page
    By chasery in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 13 Apr 2010, 07:37 PM
  4. Using CSS Buttons yet still see graphic buttons on some pages
    By newbie73 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 24 Jul 2007, 12:51 PM

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