Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Location
    Israel
    Posts
    161
    Plugin Contributions
    0

    Default CSS Button won't work :(

    Hi,

    I have set up my store to use CSS buttons over images and there seems to be a problem with one of the buttons, it just won't replace from an image to CSS based button. Check the pic, it's the pink button.

    Side note: I noticed a bug worth mentioning. If you ever defined new buttons that are saved as .jpg you have to go back to button_names.php and change .jpg to .gif. Otherwise CSS buttons won't work for those specific buttons.

    Whoever can help with my problem I'll be glad!

    [SCR]http://img32.imageshack.us/img32/7374/csserror.jpg[/SCR]
    Last edited by Kim; 21 Aug 2009 at 03:00 PM.

  2. #2
    Join Date
    Jun 2009
    Location
    Israel
    Posts
    161
    Plugin Contributions
    0

    Default Re: CSS Button won't work :(

    Nevermind, figured it out on my own. It was the template which had wrong button parameters. Set it up right and it works like a charm! :)

  3. #3
    Join Date
    Jan 2010
    Location
    Switzerland
    Posts
    19
    Plugin Contributions
    0

    Default Re: CSS Button won't work :(

    Dear Asdesign,

    sometimes it helps others when you describe in more detail how you fixed your problem even when it appeared trivial to you.
    I had the same thing. One button was not displayed as text, but as an image.

    Eventually, after a long search I found the error where I would not have expected it at all. There is a very strange condition in html_output.php, line 267 (in my version)

    Code:
    strlen($alt)<30
    So: any text longer than 30 characters is displayed as an image. Why???
    My text is longer. Condition removed, all works well.

    Cheers,
    Ralf.

  4. #4
    Join Date
    Jun 2009
    Location
    Israel
    Posts
    161
    Plugin Contributions
    0

    Default Re: CSS Button won't work :(

    Quote Originally Posted by lausianne View Post
    sometimes it helps others when you describe in more detail how you fixed your problem even when it appeared trivial to you.
    I actually kinda do that, maybe not on this post but on most of my posts I usually do.

    Anyway, you seem to have run through a different problem than the one I had but nice to see you got it solved. If one ever searches a solution for such a problem he'll probably find it with ease!

  5. #5
    Join Date
    Jan 2010
    Location
    Switzerland
    Posts
    19
    Plugin Contributions
    0

    Default Re: CSS Button won't work :(

    Hi,

    thanks for your reply. Yes, you probably do. It's just a bit frustrating when you're looking for a solution, then find a post where someone says he solved it but not how. ... Maybe I've done it myself before.

    Anyway, I just found out why this piece "strlen($alt)<30" was there. Dirty. There are a few buttons that have long descriptions and there is little space for a button, e.g. update cart. Good thing to have an image there even when they are turned off. So if the text is looong (>30) -> image. I call this "dirty", because it's hard coded. If it was a setting in the backend, I'd have found it earlier. Or better yet, control this with a button parameter, or a special character in the button text.

    Now I solved it like this (html_output.php, line 268 ff - my version):
    Code:
    $forceImage = $image[0];
    if ($forceImage == '*') $image = substr($image, 1, strlen($image)-1);
    //echo $forceImage . '<br/> Image: ' . $image; 
    if ((strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') && ($forceImage <> '*')) return zenCssButton($image, $alt, 'submit', $sec_class /*, $parameters = ''*/ );
    And in icon_names.php:
    Code:
    define('ICON_IMAGE_UPDATE', '*button_update_cart.gif');
    Better ideas welcome!

    Cheers,
    Ralf.

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

    Default Re: CSS Button won't work :(

    The CSS buttons add on solves it like this:

    - No limit on text length

    - Admin option to use image buttons if images are found on the server (Use CSS buttons only. Or use CSS buttons, but let button images override the CSS buttons.)

  7. #7
    Join Date
    Jan 2010
    Location
    Switzerland
    Posts
    19
    Plugin Contributions
    0

    Default Re: CSS Button won't work :(

    Thanks, Paul, that's of course a cleaner solution.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 21 Dec 2013, 02:15 PM
  2. Download button won't work
    By antoniuk in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 24 Feb 2008, 04:53 AM
  3. Bug? Category Specific CSS won't work on category id 1
    By alanekilauea in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Sep 2007, 08:18 PM
  4. /admin won't work
    By evolive in forum General Questions
    Replies: 1
    Last Post: 2 Nov 2006, 10:31 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