If this is your first visit, check our documentation. To post, register or login.

CSS buttons v2.x

Started by paulm on 19 Sep 2006, 7:55 PM · Views: 41,343

Results 81 to 100 of 159
1 Mar 2009, 6:46 PM
#81
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #81 by sawhorse

I have 3 quick questions.

1) Does this mod work with ZC 1.3.8a?
2) If the mod does work in ZC 1.3.8a, are we to use the html_output-138.php file (renaming it to html_output.php) found in the extra directory instead of modifying our html_output.php (found in our site's includes/functions/) as noted in the readme.txt file?
3) Are there any known conflicts with other mods? Please see below list of the mods I am using on my site.
I ask because I tried to install and had to uninstall because it did not function correctly. I assume that I made an error in the install process, but I am not sure. Below are the errors that occurred:
1) I could not turn off the CSS buttons (“admin :: Configuration :: Layout Settings :: CSS Buttons”)
2) The buttons were red.
3) I did not have in admin css-buttons: (“admin :: Configuration” (at the bottom))
Thanks for any answers,
Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

1 Mar 2009, 6:49 PM
#82
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #82 by sawhorse

I may have an answer to one of my own questions.
Question # 3) I did not have in admin css-buttons: (“admin :: Configuration” (at the bottom))

That could be because I did not give myself admin control of it in Admin Profiles.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

1 Mar 2009, 11:30 PM
#83
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Post #83 by paulm

Q1: Yes, this mod works with 1.3.8a

Q2: Yes, on a clean install you can copy html_output-138.php and overwrite includes/functions//html_output.php . If in doubt compare the file to your file using a file compare tool.

Q3: I don't exepect any conflicts.

  1. I could not turn off the CSS buttons (“admin :: Configuration :: Layout Settings :: CSS Buttons”)
    That is a standard Zen Cart setting, it's not added by this mod.
  1. The buttons were red.Is that an error?
  1. I did not have in admin css-buttons: (“admin :: Configuration” (at the bottom))Looks like you answered this one yourself :smile:
1 Mar 2009, 11:38 PM
#84
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #84 by sawhorse

paulm,

 Thanks for the information.  As I suspected - operator error. 

 I will try again, and maybe this time I can do it correctly.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

2 Mar 2009, 6:50 AM
#85
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #85 by sawhorse

Well I have tried again, and I believe that I have most of the mod correctly adjusted. However, I have five questions.

  1. If I change the stylesheet_css_buttons.css under [MY TEMPLATE] should I also copy that changed stylesheet_css_buttons.css to my admin/includes/ folder?
  2. I am adding text for the poups in includes/languages/english/extra_definitions/css_buttons_popups.php file. However, there is also a css_buttons_popups.php file under the admin section of ZC. Do I need to add the popup info in that file as well? It does not seem to need it.
  3. How do I change the position of the pop-up show button? Currently it shows tight and straight below the css button. I would prefer it to show, much like the ones on the standard ZC image buttons, below and to the right and with a bit of space between the popup and the css button image.
  4. I am testing with the BUY NOW css button and its image is working on “ALL PRODUCTS page. However, I do not get the css button image on the individual product page listings. I do get the small text “buy now” and the popups, but there are no css button images. Do you have a cure for this issue?
  5. The BUY NOW css button images on “ALL PRODUCTS page are very close each product name. How do I add a bit of space between the two.
    I have set my site to use css buttons if you wish to visit.

PS. I see you like red buttons ;-)

Thanks,
Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

8 Mar 2009, 10:56 PM
#86
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #86 by sawhorse

  • Bump -

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

9 Mar 2009, 4:55 PM
#87
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Post #87 by paulm

1 & 2: only if you are using css buttons in the admin and would like to make use of those modifications in the admin.

3, 4 & 5: an url might help (although I can not promise I will have time soon to look at it)

4: may also be related to a conflict between the css buttons Add On and the built in Zen css buttons, both have to be enabled.

10 Mar 2009, 2:36 AM
#88
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #88 by sawhorse

paulm,

 Thanks for your response to questions 1 & 2.  It makes perfect sense.

 Regarding questions 3, 4 & 5 my url is [sawhorsejewelry.com](http://sawhorsejewelry.com)  You can also see the addons that I used on this site in my signature at the bottom of my response.

I will turn on the CSS buttons. I do think you have a point that the built in ZC CSS buttons may be causing a problem. I hope you can resolve this issue.

I believe that the original ZC CSS buttons were working correctly (with the exception of the several buttons in the cart) before I added this mod.

If anyone can help correct this I believe you can, because it is my understanding you are the author of not only this mod but the original ZC CSS button code.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

10 Mar 2009, 4:05 PM
#89
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #89 by sawhorse

Using Firebug to inspect the elements of the All Products listing (which displays the CSS buy button correctly) I see that the button used is "cssButton button_buy_now"
```
<span class="cssButtonLinkPopup">
<span class="cssButton button_buy_now" onmouseout="this.className='cssButton button_buy_now'" onmouseover="this.className='cssButtonHover button_buy_now button_buy_nowHover'">Buy Now</span>
<strong>Buy Now</strong>
</span>

[/FONT]     Using Firebug to inspect the elements of the any of the individual products (Earrings, Necklaces, & Pendants listings (which displays the CSS buy button **incorrectly**) I see that the button used is "listingBuyNowButton"
```
  <span class="cssButtonLinkPopup">
  <span class="listingBuyNowButton">Buy Now</span>
  <strong>Buy Now</strong>
  </span>
```
    It seems that we are getting two different buttons depending on the type of listing. One appears to be CSS and one does not.

Sawhorse





ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

10 Mar 2009, 7:43 PM
#90
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Post #90 by paulm

The buttons in your product listing are missing the cssButton class. This class is needed to make the buttons look like (css) buttons.

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)

On a default 1.3.8 install + the css buttons add on, the product listing css buttons work fine.

11 Mar 2009, 12:22 AM
#91
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #91 by sawhorse

paulm:

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

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

11 Mar 2009, 2:05 AM
#92
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #92 by sawhorse

Paulm, I believe I have found the source of the problem.

Please go to includes/function/html_output.php

Using the original html_output.php file the css button Buy Now is visible and works.

Original code - about line 293
```
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,  the CSS Buy Now button is not visible.
  
  Suggested replacement code```
    // bof css buttons (button)
      if (css_button_allowed($image) === TRUE) return css_button($image, $alt, 'button', $parameters);
      // eof css buttons
```  Now that we know where the problem is the question becomes, how to fix it?

Sawhorse


ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

11 Mar 2009, 9:48 AM
#93
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Post #93 by paulm

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.

11 Mar 2009, 2:37 PM
#94
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #94 by sawhorse

paulm:

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?

paulm:

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

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

11 Mar 2009, 3:18 PM
#95
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Post #95 by paulm

Sawhorse:

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.

12 Mar 2009, 12:48 AM
#96
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #96 by sawhorse

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 the original code in includes/function/html_output.php at about line 293 is replaced with the new suggested code found in readme.txt for CSS buttons version 2.6.4, page 2 - Step 3, the CSS Buy Now button is not visible.

Thus, the question remains- how do we correct?

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

12 Mar 2009, 11:19 AM
#97
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Post #97 by paulm

Hi Sawhorse,

I finally found the cause of the problem! :cool:

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).... :wacko:

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 :smile:

In includes/functions/extra_functions/css_buttons.php find:

  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:

  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.)

13 Mar 2009, 3:23 AM
#98
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #98 by sawhorse

Paulm,
It works great :clap:

Now I know its easy for you to say> paulm:

...once I found the exact cause of the problem, the solution was quite easy to find :smile: 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

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

16 Mar 2009, 8:49 AM
#99
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Post #99 by paulm

Glad to hear that it fixed the issue :smile:

Sawhorse:

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 :lamo:

16 Mar 2009, 12:51 PM
#100
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #100 by sawhorse

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

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com