Forums / Templates, Stylesheets, Page Layout / CSS buttons not fully working for some buttons in my shopping_cart page

CSS buttons not fully working for some buttons in my shopping_cart page

Locked

Started by chasery on 10 Apr 2010, 4:23 PM · Views: 2,408

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
10 Apr 2010, 4:23 PM
#1
chasery avatar

chasery

New Zenner

Join Date:
Apr 2010
Posts:
9
Plugin Contributions:
0

CSS buttons not fully working for some buttons in my shopping_cart page

Got what should be a pretty simple fix... lol

I have css buttons on, but it seems it misses a few in my shopping cart. I can't seem to locate a file that generates the input for that.

http://www.raoptics.com/shop/index.php?main_page=shopping_cart

11 Apr 2010, 2:05 AM
#2
chasery avatar

chasery

New Zenner

Join Date:
Apr 2010
Posts:
9
Plugin Contributions:
0

Re: CSS buttons not fully working for some buttons in my shopping_cart page

Upon further searching, I have figured out where it is being created.

html_output.php

/*
 * The HTML form submit button wrapper function
 * Outputs a "submit" button in the selected language
 */
  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($image, DIR_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;
  }

Is there a way to modify this so that the update button is replaced with a text version? I really could use some help here.

11 Apr 2010, 2:27 AM
#3
chasery avatar

chasery

New Zenner

Join Date:
Apr 2010
Posts:
9
Plugin Contributions:
0

Re: CSS buttons not fully working for some buttons in my shopping_cart page

I don't understand how there is no input on this topic considering this is coming from a default set up.

I can't be the only person that has turned off the button images to style them in css and had the update cart button remain as a image.

11 Apr 2010, 1:17 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: CSS buttons not fully working for some buttons in my shopping_cart page

You're not.

http://www.zen-cart.com/forum/showthread.php?t=44677

I think there are other threads, too.

That button remains an image when CSS buttons are selected, even in a stock Zencart installation.

12 Apr 2010, 12:19 AM
#5
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: CSS buttons not fully working for some buttons in my shopping_cart page

Are you using the default CSS buttons, which comes as part of the default ZC package? Or are you using the more up-to-date mod called CSS Buttons, in the Free Software Add Ons (link top-left)?

If the latter, you should not have a graphic button there; it should be styled text, just like all the rest. (At least mine is, on both my sites, and I don't recall making any code edits to get it to behave that way.)

Rob

Breakfast: the most important donut of the day.

12 Apr 2010, 9:38 PM
#6
chasery avatar

chasery

New Zenner

Join Date:
Apr 2010
Posts:
9
Plugin Contributions:
0

Re: CSS buttons not fully working for some buttons in my shopping_cart page

Ok, after reading your post regarding the css-buttons mod, I have attempted to install it but have an odd issues when editing the html_output.php...

-=-=-=-=-=-=
Step 3)
-=-=-=-=-=-=
Open includes/functions/html_output.php (do not forget to backup first!)

a) find(1.3.6/1.3.7 line 267):

if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class /, $parameters = ''/ );

replace by:
// bof css buttons (submit)
if (css_button_allowed($image) === TRUE) return css_button($image, $alt, 'submit', $parameters);
// eof css buttons

b) find (1.3.6/1.3.7 line 293 before edits):
if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') return zenCssButton($image, $alt, 'button', $sec_class, $parameters = '');

replace by:
// bof css buttons (button)
if (css_button_allowed($image) === TRUE) return css_button($image, $alt, 'button', $parameters);
// eof css buttons

Following this step and replacing those exact lines cause my shop not to load... Honestly I am lost at this point.

Whats interesting is that the sql info is in, I have the the CSS Button menu under Configuration in the admin panel... The styles are going through, but when I replace that html_output.php file with what the directions for the mod says, it breaks the cart... I have been looking for an explanation to this, but cant seem to find why this does this or even an adjustment to fix it.

13 Apr 2010, 1:42 PM
#7
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: CSS buttons not fully working for some buttons in my shopping_cart page

I recall also having a problem with the html_output.php file when I did the mod install. Replacing the original unedited file got the site working again. I then very carefully edited the file as instructed and it worked the second time.

I believe that, the first time, I had copied and pasted text from the readme or the install instructions, and doing that brought in an invisible character -- probably a line end or odd CR form -- which caused a problem. My editor, BBEdit, has a Zap Gremlins function which is designed to kill such things. I ran that after editing the file. Whether it was my more careful second editing or the Zapping that cured the problem, it worked the second time around.

If you still can't get it working, PM me with your email address and I'll send you a copy of my html_output.php file.

Rob

Breakfast: the most important donut of the day.

13 Apr 2010, 3:31 PM
#8
fozzyo avatar

fozzyo

New Zenner

Join Date:
Mar 2006
Location:
Wolverhampton, UK
Posts:
31
Plugin Contributions:
0

Re: CSS buttons not fully working for some buttons in my shopping_cart page

Just to say, installed the CSS Buttons mod and works perfectly for me. Lot easier then trying sort out the buttons myself. :)

13 Apr 2010, 6:37 PM
#9
chasery avatar

chasery

New Zenner

Join Date:
Apr 2010
Posts:
9
Plugin Contributions:
0

Re: CSS buttons not fully working for some buttons in my shopping_cart page

Well I just fixed the problem. Really it was just solved by modifying the tpl_shopping_cart_default.php slightly and using the over ride system.

Original around line 135:

<?php
// show update cart button
  if (SHOW_SHOPPING_CART_UPDATE == 2 or SHOW_SHOPPING_CART_UPDATE == 3) {
?>
<div class="buttonRow back"><?php echo zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT); ?></div>
<?php
  } else { // don't show update button below cart
?>

Replace with:

<?php
// show update cart button
  if (SHOW_SHOPPING_CART_UPDATE == 2 or SHOW_SHOPPING_CART_UPDATE == 3) {
?>
<div class="buttonRow back"><?php echo zen_image_submit(BUTTON_IMAGE_UPDATE, BUTTON_UPDATE_ALT); ?></div>
<?php
  } else { // don't show update button below cart
?>

Now I do not need the css button plugin that has seemed to cause other problems specifically for me.