Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33
  1. #1
    Join Date
    Jun 2006
    Location
    Salem, West Virginia
    Posts
    15
    Plugin Contributions
    0

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

    Hello there!

    I believe there is a bug in Zen Cart 1.3.5 on the Send Gift Certificate Confirmation page.

    Here's how to replicate the problem: (1) Log in with a Balance in your Gift Certificate Account and go to the Send a Gift Certificate page. (2) Fill in the form and click "Send Now". (3) You are taken to a "Send Gift Certificate Confirmation" page to review your message before sending it. But wait! You're supposed to be able to click "Edit" if you would like to re-edit your message before you send it. However, when I click "Edit", Zen Cart sends the Gift Certificate! Oops.

    This is happening for me with the default template so I don't believe it's any code that I've changed. Can any one else confirm that this is a bug in Zen Cart that needs fixed?

    Thanks!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Edit Bug on the Send Gift Certificate Confirmation page?

    I cannot replicate this error ...

    I tell it send $25 ...

    I click Edit ...

    I get taken back to fill out the info ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Edit Bug on the Send Gift Certificate Confirmation page?

    Would be helpful to know what browser and operating system you're using, as well as what hosting platform (windows/linux) and what version of PHP is on your server.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jun 2006
    Location
    Salem, West Virginia
    Posts
    15
    Plugin Contributions
    0

    Default Re: Edit Bug on the Send Gift Certificate Confirmation page?

    Thanks for the quick feedback! You guys are great!

    I think I found the catch -- I have CSS buttons enabled. It seems to work great when I disable CSS buttons.

    Sooo, when CSS buttons are disabled, I get this code and everything works fine:

    Code:
    <input type="image" src="includes/templates/template_default/buttons/english/small_edit.gif" alt="Edit" title=" Edit " name="edit" value="edit" />
    But, when CSS buttons are enabled, I get this code and the EDIT button submits the form instead of editing it:

    Code:
    <input class="cssButton small_edit" onmouseover="this.className='cssButtonHover small_edit small_editHover'" onmouseout="this.className='cssButton small_edit'" type="submit" value="Edit" style="width: 80px;" />
    Hmmm. Peering into tpl_gv_send_default we see the following:

    Code:
    <?php echo zen_image_submit(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT, 'name="edit" value="edit"') ?>
    And so, it looks like CSS buttons aren't picking up that necessary last parameter in the zen_image_submit, eh? So, running over to html_output.php, I take a look at the zen_image_submit() function. On line 262 (in my file at least) I noticed the $paramters variable is commented out:

    Code:
    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class /*, $parameters = ''*/ );
    I don't think I did that. So why is it commented out? Well, looking at the zenCssButton() function on line 320 (in my file at least) we see:

    Code:
    $css_button = '<span class="' . $mouse_out_class . '" ' . $css_button_js . $style . ' >&nbsp;' . $text . '&nbsp;</span>'; // add $parameters ???
    So the $parameters variable, even if it was passed to the zenCssButton() function, still wouldn't print. I would guess, then, that it's a feature still needing to be worked out?

    Anyway, all this to ask, do you think it might be a possibility to use CSS Buttons and still have the Gift Certificate edit button work? Any creative solutions would be really appreciated. This "bug" is really "bugging" me.

    Thanks a lot!

  5. #5
    Join Date
    Jun 2006
    Location
    Salem, West Virginia
    Posts
    15
    Plugin Contributions
    0

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

    OK, everybody, if you want to enable CSS buttons and use gift certificates (doesn't anybody else out there use both of these features?) the only solution I've found to fix the "Edit" link on the Send Gift Certificate Confirmation page is as follows (applies to ZenCart 1.3.5):

    1. Open up includes/functions/html_output.php and change this line:
    Code:
    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class /*, $parameters = ''*/ );
    to this:
    Code:
    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class, $parameters);
    2. Open up includes/modules/pages/gv_send/header_php.php and, in both places where it is found, change this line:
    Code:
    if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) {
    to this:
    Code:
    if (isset($_POST['edit_x']) || isset($_POST['edit_y']) || isset($_POST['edit'])) {
    3. Finally, open up your template at includes/templates/YOUR_TEMPLATE_FOLDER/templates/tpl_gv_send_default.php (if it doesn't exist there, copy the file there from includes/tempmlates/template_default/templates/tpl_gv_send_default.php)
    Change this line:
    Code:
    <div class="buttonRow back"><?php echo zen_image_submit(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT, 'name="edit" value="edit"') ?></div>
    to this:
    Code:
    <div class="buttonRow back"><?php echo zen_image_submit(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT, 'name="edit"') ?></div>
    I know it's an ugly fix (modifying two untemplated files!? gasp) but it's the only way I can find to fix the problem. I'm still testing the results to make sure it doesn't break anything else on the site.

    Ajeh? DrByte? Any better solution? Please?

  6. #6
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

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

    The $paramaters var was commented out by me in a beta version of the CSS buttons contrib. Unfortunately that version was added to the core code.

    The reason to comment out the $parameters in the first place was that any inline settings, like inline CSS for example, could mess up the buttons. That is why the $parameters are still commented out for link buttons in the current css buttons contrib (although I doubt if recent Zen versions really use this $parameters for any of the buttons). But for input buttons the $parameters values indeed are important in some cases.

    I am suprised by the other modifications though, which seem to be needed to make that button work
    Last edited by paulm; 5 Oct 2006 at 11:53 PM.

  7. #7
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

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

    I did a test and the edit button indeed appears to sent the certificate (also with the css contrib that has the $parameters enabled).


    Not sure if this is related, and where it comes from, but I noticed that: value="Edit" i.s.o. value="edit".
    Code:
    <input class="cssButton small_edit" onmouseover="this.className='cssButtonHover small_edit small_editHover'" onmouseout="this.className='cssButton small_edit'" value="Edit" type="submit"></div>

  8. #8
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

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

    Oooooops, the parameters are not passed in the latest version of the contribution either (the function accepts $parameters, but no $parameters are passed to it).

    The cause of theproblem seems to be with another issue though (also something I overlooked ): the button type is set to submit "submit" by de css buttons function, while the original type is "image", when I change it to type="image" the button work as it should, but....... pfft it's bedtime here.

  9. #9
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

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

    Hi Uncle Bob,

    if you still feel like testing :-)

    Could you try only making change 1. *and* after that line add:
    Code:
     if (strpos($parameters, 'name="edit"')!=false) $parameters = ' name="edit_x"';
    But without the 2. and 3. changes!

    I am not saying that this would be the final solution, even if it works perfectly. But it would help to pin point the problem. And removes the need to edit any other code than the css buttons function itself.

  10. #10
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

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

    I noticed something which seems a bit strange here:
    Code:
    if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) {
    Why does it check for edit_x OR edit_y ?Why not just for edit? The _x and _y's are added by type="image" inputs, but why are those being used if the name="edit" value is available?

    When I add the parameters (step 1.) and change the GV code to:
    Code:
    if (isset($_POST['edit'])) {
    It seems work fine again......

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Replies: 0
    Last Post: 21 Dec 2013, 02:15 PM
  2. Problem with the Gift Certificate send page
    By mom2da3ks in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Feb 2011, 05:44 PM
  3. [Done v2.0] CSS Buttons bug on gv send page
    By s_mack in forum Bug Reports
    Replies: 18
    Last Post: 14 Aug 2009, 08:14 AM
  4. Send Gift Certificate Confirm/Edit Buttons Don't Work - using Bookshelf template
    By ToniScraparoni in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 4 Jun 2009, 11:23 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR