Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Locked

Views: 13,394

Results 21 to 34 of 34
This thread is locked. New replies are disabled.
24 Oct 2006, 4:05 PM
#21
uncle_bob avatar

uncle_bob

New Zenner

Join Date:
Jun 2006
Location:
Salem, West Virginia
Posts:
15
Plugin Contributions:
0

Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

The code that you posted earlier that doesn't work for me is this snippet which you said you added to the CSS Buttons Function:

  if ($type == 'submit'){
  // form input button
    $css_button = '<input class="' . $mouse_out_class . '" ' . $css_button_js . '  type="submit" value="' .$text . '"' . $parameters . $style . ' />';
    // bof hack to simulate image button! (add _x and _y parameters to $_POST)
    // needed for gv name="edit" button (other named buttons are name="btn_submit" and name="submit1" and ...??)
    if (strpos($parameters, 'name')!== false){
      $s=strpos($parameters, '"', strpos($parameters, 'name'))+1;
      $e=strpos($parameters, '"', $s);
      $name = substr($parameters, $s, $e-$s);
      $_SESSION['buttons_name_array'][] = $name; // debug
      $css_button .= "\n" . '<input type="hidden" name="' . $name . '_x" value="1" />';
      $css_button .= "\n" . '<input type="hidden" name="' . $name . '_y" value="1" />';
    }
    // eof hack to simulate image button!
  }

What that will do on a default Zen Cart installation is add two hidden input forms named edit_x and edit_y that are submitted with the Gift Certificate Confirmation form. And, naturally, they are submitted whether the "Edit" button or the "Submit" button is used. Therefore, both buttons take me back to the edit page. Am I making any sense?

Good luck on your CSS Buttons mod! I haven't tried it out yet but I just might take it for a spin. Do you mind filling me in again on what additional features it offers that the default Zen Cart CSS Buttons don't?

24 Oct 2006, 4:19 PM
#22
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Hi guys, I'm posting here so I can keep up with this thread. It is related to this bug report I put in, but its probably best to keep the discussion going here and then post a final solution there (or seperately). I discovered the bug in a more generic sense... but it really is the same thing. I hope when you figure out a solution, that it is also generic (not specific for gv). Parameters should be accepted by all functions that produce elements without id tags, otherwise contribs have no way of controlling those elements without modding core files (never a good thing).

  • Steven
24 Oct 2006, 5:53 PM
#23
paulm avatar

paulm

Totally Zenned

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

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Steven, nice to see you here too :-D

I understand you point Steven, and I agree of course. By itself the $parameters issue is not difficult to fix, and it won't be fixed only for the GV buttons (within the css buttons contrib). It's just coïncidense that the bug you reported and this bug both are related to the $parameters. The problem is that only adding the parameters is not enough to fix this GV button issue.

*Bob:

You are right of course! :blush: Now I only wonder why the heck it works on my testshop..... ??? (Maybe it's a Heisenbug? http://en.wikipedia.org/wiki/Heisenbug only joking :P )

Hmmm... but it seems probably the only way to fix this within the css buttons code then, is to add an _x or_y name and value to the button itself. I think I will try that as a last resort...

Thanks for the feedback Bob!

24 Oct 2006, 8:13 PM
#24
paulm avatar

paulm

Totally Zenned

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

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Ok I admit, I am getting to old for this ;-)

I forgot to put back the original deafult gv_send header file :rolleyes: That is why the formentioned fix worked on my install (I found out the hard way, while I was looking why my new fix did not work).

Now I am using this fix (part of the css_button function again):

  if ($type == 'submit'){
  // form input button
    // bof hack to simulate image button (replace parameter by _x parameter)
    if (strpos($parameters, 'name')!== false){
    // replace by regular expression
      $s=strpos($parameters, '"', strpos($parameters, 'name'))+1;
      $e=strpos($parameters, '"', $s);
      $name = substr($parameters, $s, $e-$s);
      // replaces the value of name only
      $parameters = substr_replace($parameters, $name . '_x', $s, $e-$s);
    }
    // eof hack to simulate image button 
    $css_button = '<input class="' . $mouse_out_class . '" ' . $css_button_js . ' type="submit" value="' .$text . '"' . $parameters . $style . ' />';
  }
```(note that the whole hack could be replaced by a single regular expression.....)

This way it really should work without editting anything else than the css buttons code (I hope! :P ). But I understand if you do not feel like testing this anymore Bob ;-)
24 Oct 2006, 8:32 PM
#25
paulm avatar

paulm

Totally Zenned

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

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Do you mind filling me in again on what additional features it offers that the default Zen Cart CSS Buttons don't?Almost forgot to answer that one.

Most of the differences are described here: http://www.zen-cart.com/forum/showthread.php?t=46705

But if you do not need image buttons for one or some buttons, and if you've already revamped the messy CSS, and no problems with the width of the stock Zen CSS buttons there is no real need to upgrade I suppose.

24 Oct 2006, 8:39 PM
#26
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

I'm glad you mentioned widths... I forgot. I don't see where in your contrib it does anything with the widths. I remember seeing in the readme that it automatically sizes them... how? I wonder if perhaps I have the wrong fileset.

  • Steven
24 Oct 2006, 8:48 PM
#27
paulm avatar

paulm

Totally Zenned

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

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

s_mack:

I remember seeing in the readme that it automatically sizes them... how?Actually the current version does not automaticly size the button widths (maybe I need to correct the readme on this), but it lets the browser do it.

(while most older versions tried to calculate the width using the number of characters, which is quite inaccurate of course)

You can also (and might need to do so, for some buttons) set the width of individual buttons in the stylesheet, without adding "!important" to the width setting.

24 Oct 2006, 9:01 PM
#28
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Yeah, I figured that out. What I can't figure out is why my <input> buttons render completely different from my <span> buttons. I've stripped down my css and pulled my hair out for hours, but all my submit (input) buttons have some padding on the top and bottom AND the height of the buttons are greater. Very frustrating. But minor.

  • Steven
24 Oct 2006, 9:29 PM
#29
paulm avatar

paulm

Totally Zenned

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

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Yeah, it's not always easy (at least not as easy as I hoped) to style this mix of, dynamicly generated, input and link buttons.

I tried several examples found on the internet for both link buttons and input buttons, but these examples usually are about static (fixed width and height), and about link or input buttons, not about a mixture of both. I even found several examples that seemed to work great at first sight, but appeared to be completely worthless in practice!

But we're off topic here. I guess we better try to keep this thread focussed on the GV button bug, and post other CSS button issues to other treads.

(if you like, and you can post a link in the current CSS buttons mod thread, I will try to help to fix the problem you have with the padding)

27 Oct 2006, 3:31 PM
#30
paulm avatar

paulm

Totally Zenned

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

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

@Bob:

I just tested the fix on a clean 1.3.6 install (so now I am really sure it was a totally clean install :-) ) and the fix appears to work as it should now.

6 Nov 2006, 5:44 AM
#31
sybil avatar

sybil

New Zenner

Join Date:
Jul 2006
Posts:
13
Plugin Contributions:
0

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

:down: This fix isnt working for me using default 1.3.6 css buttons. Forgive me if Ive missed something in the thread. Ive been wracking my brain over this edit thing for 4 hours now. It works fine with image buttons but not with css... & none of the fixes here are working. Any suggestions?

paulm:

Now I am using this fix (part of the css_button function again):

if ($type == 'submit'){
// form input button
// bof hack to simulate image button (replace parameter by _x parameter)
if (strpos($parameters, 'name')!== false){
// replace by regular expression
$s=strpos($parameters, '"', strpos($parameters, 'name'))+1;
$e=strpos($parameters, '"', $s);
$name = substr($parameters, $s, $e-$s);
// replaces the value of name only
$parameters = substr_replace($parameters, $name . '_x', $s, $e-$s);
}
// eof hack to simulate image button
$css_button = '<input class="' . $mouse_out_class . '" ' . $css_button_js . ' type="submit" value="' .$text . '"' . $parameters . $style . ' />';
}

> 
> This way it really should work without editting anything else than the css buttons code (I hope! :P ). But I understand if you do not feel like testing this anymore Bob ;-)
6 Nov 2006, 7:54 AM
#32
paulm avatar

paulm

Totally Zenned

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

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Hi Sybil,

this thread is probably quite confusing and if you can't get the proposed fixes to work, you can also use the latest version of the css buttons contribution. I have uploaded v2.4 here: http://www.zen-cart.com/forum/showpost.php?p=284957&postcount=12

8 Nov 2006, 4:07 PM
#33
sybil avatar

sybil

New Zenner

Join Date:
Jul 2006
Posts:
13
Plugin Contributions:
0

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Thanks Paul! I'll grab it now. :)

3 Jun 2009, 2:56 PM
#34
toniscraparoni avatar

toniscraparoni

Zen Follower

Join Date:
Apr 2009
Posts:
158
Plugin Contributions:
0

Re: Edit Bug on the Send Gift Certificate Confirmation page using CSS buttons

Hi, guys!

Need help big-time, please. I've searched everywhere and tried every fix I can find referenced in this thread and http://www.zen-cart.com/forum/showthread.php?t=50086, nothing has worked. Hence why I'm reviving this one. Apparently this bug, or a variant, continues, even in 1.3.8a.

All was fine while I was using a self-modified version of the Classic template. Send Gift Certificate buttons worked perfectly. However, after redecorating using a self-modified version of the Bookshelf template, my Gift Certificate Edit and Confirm Send buttons no longer work. CSS buttons have never been enabled.

I had a semi-similar issue with the Add to Cart button after changing style sheets. The button moved to the left-hand side when it had been, and I wanted it, on the right. Moving the selector out of the cart section fixed it. So, would it be logical to assume the gift certificate buttons can be fixed through the style sheet, as well? Even though I'm sure that would be too easy, right? ;)

Many thanks in advance for your help!