Forums / General Questions / Double click problem

Double click problem

Locked

Views: 9,638

Results 1 to 20 of 32
This thread is locked. New replies are disabled.
16 Mar 2007, 5:12 PM
#1
ngr avatar

ngr

New Zenner

Join Date:
Dec 2006
Posts:
23
Plugin Contributions:
0

Double click problem

Hello,
We have some customers that click the final confirmation button checkout twice, sometimes i receive the order twice (i have no problem with that because i use an offline payment processor) but sometimes the customer and the shop owner never receive the confirmation email.

Is there anything that can be done within ZenCart to avoid customer to click twice in th buttons?
Thanks,
Nicolas

19 Mar 2007, 6:34 PM
#2
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Double click problem

What version are you running? 1.3.7 has a built-in JavaScript function to disable the submit button for a few seconds after being pushed. It's actually been in there since at least April '06.

Take a look at includes/modules/pages/checkout_confirmation/jscript_main.php. In there you should find the function submitonce().

Then, go to the template file (includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_confirmation_default.php) and make sure there's a call to that function in there...

echo zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="[B]submitonce()[/B];"');

If any of that stuff is missing, you're running an older version, and need to upgrade.

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

30 Apr 2007, 9:24 PM
#3
tbrides avatar

tbrides

Zen Follower

Join Date:
Oct 2006
Posts:
198
Plugin Contributions:
0

Re: Double click problem

hi,

im having the same problem

we got some code from our payment gateway provider, wont mention who.

their code is a mess and a hack at understanding at how zen cart works.

they have somehow disabled that script and now the form is using

onsubmit="return CheckOk()"

i cant bloody find where to change it back

5 May 2007, 3:59 PM
#4
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Double click problem

If you were able to find out what the onsubmit attribute is currently set to, then I'd say you already found it. Or am I missing something? :blink:

You need to set that to onsubmit="submitonce();", and make sure that the page setup (includes/modules/pages/[PAGE NAME]) includes the javascript as I described above.

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

5 May 2007, 4:25 PM
#5
tbrides avatar

tbrides

Zen Follower

Join Date:
Oct 2006
Posts:
198
Plugin Contributions:
0

Re: Double click problem

yep found it. it had been changed in html_output

22 Jun 2007, 9:51 PM
#6
debs avatar

debs

New Zenner

Join Date:
Jun 2007
Posts:
2
Plugin Contributions:
0

Re: Double click problem

I am having the same problem with multiple clicking on the confirm button at the end of checkout.

I have version 1.3.7 and the submitonce javascript is all there however this script only seems to work in Firefox. When you go through checkout using Internet Explorer you can click on the button many times and you get a many order each with a different order number but the same items.

Is there any different code to stop this in IE?

26 Jun 2007, 10:17 PM
#7
mrforce avatar

mrforce

New Zenner

Join Date:
Aug 2006
Location:
Big D
Posts:
36
Plugin Contributions:
0

Re: Double click problem

Same problem here.

I'm running v1.3.7 with the submit_once jscript in place. All bounces are from custommers using I.E.

I use Google Analytics and the Analytics server has been slow recently, which seems to be making customers panic and press the submit button a second time.

Craig

Craig

27 Jun 2007, 1:33 PM
#8
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Double click problem

It's likely something that IE7 broke. I honestly wonder if they're even trying anymore...

Are you guys using a graphical submit button or an <input> tag? If you're using a graphic, try switching to an <input> and use one of the multitude of JS scripts out there for disabling a submit button.

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

27 Jun 2007, 4:10 PM
#9
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,682
Plugin Contributions:
0

Re: Double click problem

I use Google Analytics and the Analytics server has been slow recently, which seems to be making customers panic and press the submit button a second time.

A slow page change **will ** cause folks to become impatient and click multiple times. You may want to add a warning to the page to only click once and to wait.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

27 Jun 2007, 9:47 PM
#10
paulm avatar

paulm

Totally Zenned

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

Re: Double click problem

Kim:

A slow page change **will ** cause folks to become impatient and click multiple times. You may want to add a warning to the page to only click once and to wait.Does this mean that there is no js double click prevention built in after all? I thought 1.3.6 and newer Zen Cart versions included some js code to prevent double clicks. But I know little about js, so I may very well be wrong.

28 Jun 2007, 10:42 AM
#11
debs avatar

debs

New Zenner

Join Date:
Jun 2007
Posts:
2
Plugin Contributions:
0

Re: Double click problem

BlindSide:

It's likely something that IE7 broke. I honestly wonder if they're even trying anymore...

Are you guys using a graphical submit button or an <input> tag? If you're using a graphic, try switching to an <input> and use one of the multitude of JS scripts out there for disabling a submit button.

Thank you Frank for your reply.

How do I change the graphical button to an input tag? I have found the code I think needs changing in the tpl_checkout_confirmation_default.php file but I don't know php all that well so I don't know how to change it. Below is the code I think needs changing:

<?php echo zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"'); if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } ?> <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONFIRM_ORDER, BUTTON_CONFIRM_ORDER_ALT, 'name="btn_submit" id="btn_submit"') ;?></div> </form>

Please could you let me know how I would change it.
Thank you
Debs

30 Aug 2007, 12:41 PM
#12
paulm avatar

paulm

Totally Zenned

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

Re: Double click problem

Is there anybody reading this that is troubled by doubling orders very frequently? (several times a day for example) If so, I am willing to try a possible solution on your shop.

It seems to have fixed it for me, but because I have not found a way to reproduce the problem I am not 100% sure, and I would like to test it on another shop as well.

14 Dec 2007, 10:22 PM
#13
wapnoj avatar

wapnoj

New Zenner

Join Date:
Oct 2006
Posts:
65
Plugin Contributions:
0

Re: Double click problem

Anyone found a simple solution for this issue? I am using 1.3.7 and all Java script is where it is supposed to be, but if a customer clicks more than once multiple orders can be created. This however can not be duplicated in FireFox. In IE7 I can easily duplicate the problem. The current submitonce code does nothing to stop the issue in IE7.

Thanks

15 Dec 2007, 8:58 AM
#14
paulm avatar

paulm

Totally Zenned

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

Re: Double click problem

What did the trick for me was to store the sessions as files (i.s.o. in the database). On shared servers this is not recommended though.

I started a topic about my findings here: http://www.zen-cart.com/forum/showthread.php?t=82029

hth

19 Dec 2007, 5:54 AM
#15
hrm avatar

hrm

New Zenner

Join Date:
Oct 2005
Posts:
95
Plugin Contributions:
0

Re: Double click problem

We are having the same problem and it is a shared server, unfortunately. I'd really like some advice about the java option.

I have switched from a graphic button to a submit button as suggested but I'm lost when it comes to Java. I tried one solution that I found, but, although the button was disabled onclick, nothing was submitted.

I also found a php suggestion in a Java forum (go figure) and here is my code for the submit button after applying this method:

<input type="submit" name="btn_submit" id="btn_submit" value="Confirm Order" <?php if (isset($_POST['act'])) echo ' disabled="disabled"' ?>/>

This seems to submit and process just fine in IE7 and Firefox; however, in IE I get an "error on page" message at the bottom while it is processing.

Any ideas? I feel I'm getting really close. :unsure: Thanks.

Heather
Results! Why, man, I have gotten a lot of results.
I know several thousand things that won't work.
----Thomas Edison

7 Jan 2008, 11:39 PM
#16
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Double click problem

Is there any more advice on this situation with double clicks?
I have all the proper code installed and also my javascript timeout is set to many MINUTES and still some customers double charge their orders.

After reading this, I can only image that it's IE7
I can't test this as I only use Macs here

Jeff Michaels,
pres of Musical Creations Ltd.

10 Jan 2008, 7:09 AM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Double click problem

If the customer's browser is an AOL browser that has javascript support disabled, then there's nothing you can do about the double-click problem other than to give them great big warnings in big letters next to the submit button.

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

10 Jan 2008, 1:13 PM
#18
jeffmic avatar

jeffmic

Zen Follower

Join Date:
Aug 2006
Location:
North Carolina
Posts:
280
Plugin Contributions:
0

Re: Double click problem

It's not just AOL
I also had another double charge this morning with IE7 on XP

SOMETHING has to be done about this
It's driving us crazy and makes the customer look pretty dumb

Jeff Michaels,
pres of Musical Creations Ltd.

11 Jan 2008, 12:56 AM
#19
tatay avatar

tatay

New Zenner

Join Date:
Dec 2007
Posts:
11
Plugin Contributions:
0

Re: Double click problem

Our Double Click problem came when a customer clicked the "Add to Cart" button four times, which placed the same item in his cart four times, even though there was only one item in stock.

Even though ZenCart indicates the second thru 4th click show that the single item is now OUT OF STOCK, It still allows the out of stock items to be added to the customer's shopping cart.

In this case, the customer completed a single order which included FOUR of the same item.

When I checked the item quantity on hand, it showed "minus 3"

PayPal promptly sent us payment for all four items.

IS THE FIX FOR THIS PROBLEM THE SAME AS THE DOUBLE CLICK ON THE ORDER CONFIRMATION BUTTON??? IS IT THE SAM JS CODE?

SHOULD WE PUT THE SAME WARNING ON OUR PAGES NOT TO CLICK MORE THAN ONCE???

:dontgetit

11 Jan 2008, 6:25 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Double click problem

Tatay:

Our Double Click problem came when a customer clicked the "Add to Cart" button four times, which placed the same item in his cart four times, even though there was only one item in stock.

Even though ZenCart indicates the second thru 4th click show that the single item is now OUT OF STOCK, It still allows the out of stock items to be added to the customer's shopping cart.

In this case, the customer completed a single order which included FOUR of the same item.

When I checked the item quantity on hand, it showed "minus 3"

PayPal promptly sent us payment for all four items.

IS THE FIX FOR THIS PROBLEM THE SAME AS THE DOUBLE CLICK ON THE ORDER CONFIRMATION BUTTON??? IS IT THE SAM JS CODE?

SHOULD WE PUT THE SAME WARNING ON OUR PAGES NOT TO CLICK MORE THAN ONCE???

:dontgetit

NO - ITS A DIFFERENT ISSUE

Your problem has nothing to do with the "clicking multiple times on the checkout confirmation button" problem discussed in this thread.
Yours is a stock configuration problem in your store. You can fix your stock settings in Admin->Configuration->Stock ... perhaps you want to disallow checkout if the cart contains out-of-stock items.

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