[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][/FONT]Code:if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') return zenCssButton($image, $alt, 'button', $sec_class, $parameters = '');
[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[FONT=Arial]Now that we know where the problem is the question becomes, how to fix it?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]
Sawhorse
[/FONT]
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.
- What needs to be updated in version 2.6.4 readme file?
- 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?
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
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.
Nope, all the instructions are correct.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?
[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]
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:
And replace with:Code:if (strpos($parameters, 'class="') === FALSE){ // only add class if no class is passed through $parameters $class = ' class="' . $mouse_out_class . '" ' . $css_button_js; }
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.)
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