Zen Cart Logo
Forums / General Questions / Order Confirmation Processing Block .. vs duplicate orders

Order Confirmation Processing Block .. vs duplicate orders

Views: 3,124

Results 21 to 35 of 35
11 Nov 2016, 3:20 PM
#21
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Order Confirmation Processing Block .. vs duplicate orders

i'm a fan of removing the button after clicking it.

on another spot on one of my sites site i used the following jquery code to remove the button:

$(function() {
    $('#auth_button img').on("click", function (e) {
        $("#auth_button a").replaceWith("<img src='includes/languages/english/images/buttons/processing.gif' border='0' alt='Waiting' title='Waiting'>");
	});
});

button replaces with:

Attachment 16782

best.

11 Nov 2016, 6:07 PM
#22
drbyte avatar

drbyte

Sensei

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

Re: Order Confirmation Processing Block .. vs duplicate orders

badarac:

carlwhat:

seems like a lot of work.... have you tried:

https://www.zen-cart.com/showthread.php?220919-Credit-Card-Getting-Charged-Twice&p=1317476#post1317476
Since implementing that on several client sites they no longer see the duplicate orders. Hope this works for you. Dr B you might want to think about increasing the time in a future update.
Willing to enterain a Pull Request.

carlwhat:

i'm a fan of removing the button after clicking it.

on another spot on one of my sites site i used the following jquery code to remove the button:

$(function() {
$('#auth_button img').on("click", function (e) {
$("#auth_button a").replaceWith("<img src='includes/languages/english/images/buttons/processing.gif' border='0' alt='Waiting' title='Waiting'>");
});
});

> 
> button replaces with:
> 
> Attachment 16782
> 
> best.
PR welcome.
11 Nov 2016, 6:13 PM
#23
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

DrByte:

Willing to enterain a Pull Request.

PR welcome.

when i get some time, i have a couple i need to work on.... very busy right now as moving primary client's payments over to cybersource.... but i hear you!

12 Nov 2016, 4:32 PM
#24
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

DrByte:

Willing to enterain a Pull Request.

PR welcome.

DrB,
i am looking at doing a PR for these things. what i was thinking was adding a variable to the configuration table for adjusting the timeout. in addition, i was also thinking about the replacement of the button with a moving gif similar to the one i posted earlier.

i am not sure the reasoning for having a 4 second timeout, as opposed to removing the ability completely to resubmit. but i'm sure there is a reason.

my question is how does one nicely get a variable into the config table for v160 (i know.... i should probably know how to do this...) and do you think that we should also add a config for completely replacing the button with a loading type of gif? or just do it and not allow users to change it?

thanks in advance.

12 Nov 2016, 6:29 PM
#25
drbyte avatar

drbyte

Sensei

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

Re: Order Confirmation Processing Block .. vs duplicate orders

Don't over think it. Less is more :)
No need for a configuration switch: There's no need for a time-limit on the timeout. 4 seconds or 44 seconds it should be irrelevant: it's waiting for the page to reload.
Just replace it with a generically-named .gif ... that way if someone wants a different gif they can just replace the file without touching the js/html at all.

13 Nov 2016, 3:40 PM
#26
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

DrByte:

Don't over think it. Less is more :)
No need for a configuration switch: There's no need for a time-limit on the timeout. 4 seconds or 44 seconds it should be irrelevant: it's waiting for the page to reload.
Just replace it with a generically-named .gif ... that way if someone wants a different gif they can just replace the file without touching the js/html at all.

while not overthinking it, my lack of ability to add a configuration switch bothered me. it seemed pretty inane that i was not able to figure it out (and i need to add one for another PR)... until now...

i'm a big fan of aliases and apparently my grep alias did not include .sql files..... silly me.

best.

23 Nov 2016, 2:54 PM
#27
lindasdd avatar

lindasdd

Zen Follower

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

Re: Order Confirmation Processing Block .. vs duplicate orders

This change has worked great. No duplicates since putting it in place whereas previously there were upwards of 20 duplicates a day.

I think the reason it worked isn't because it stopped people from placing duplicates (still possible), but rather it provided much more visual confirmation that their button clicked 'worked' and that the website was 'processing'. Therefore, they didn't start clicking around again.

So to speak to what carlwhat was mentioning (and I'm not a programmer), the timeout, button lock (or button disappearance) aren't the most important. Just the simple animated processing gif is what is most important.

23 Nov 2016, 3:09 PM
#28
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

linda,
glad it worked!

this has been incorporated into v160 of zencart. hopefully others will feel the same way.

best.

12 Dec 2016, 2:45 PM
#29
lindasdd avatar

lindasdd

Zen Follower

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

Re: Order Confirmation Processing Block .. vs duplicate orders

I upgraded one of my sites to 1.5.5b. Ever since, the upgraded site has been getting duplicates and the older one has not.

Upon testing I've noticed that on Mobile, the animated gif doesn't appear on the upgraded site and on the old one the animated gift appears, but doesn't animate.

12 Dec 2016, 3:03 PM
#30
lindasdd avatar

lindasdd

Zen Follower

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

Re: Order Confirmation Processing Block .. vs duplicate orders

Small adjustment to that last statement - the animated gif only doesn't appear when I choose CC.

Something in the programming or CSS decides a chunk of the bottom of the page doesn't need to display so it doesn't include it. Except it isn't CSS hiding the contents because the actual contents just aren't there (viewing in Firebug).

Again - only in mobile.

19 Dec 2016, 8:09 PM
#31
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Order Confirmation Processing Block .. vs duplicate orders

i would look for console errors. this fix makes use of javascript (jquery) to replace the button with an animated gif. if there is a problem loading any of the other jQuery files which results in a console error, then the replace statement would not get hit....

you should be able to see the console errors in firebug.

good luck!

27 Dec 2016, 4:31 PM
#32
lindasdd avatar

lindasdd

Zen Follower

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

Re: Order Confirmation Processing Block .. vs duplicate orders

carlwhat:

i would look for console errors. this fix makes use of javascript (jquery) to replace the button with an animated gif. if there is a problem loading any of the other jQuery files which results in a console error, then the replace statement would not get hit....

you should be able to see the console errors in firebug.

good luck!

I figured it out.

I'm using the responsive_classic template.

On mobile, this template switches to using includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php

That file didn't include the processing text, etc.

27 Dec 2016, 5:20 PM
#33
drbyte avatar

drbyte

Sensei

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

Re: Order Confirmation Processing Block .. vs duplicate orders

lindasdd:

I figured it out.

I'm using the responsive_classic template.

On mobile, this template switches to using includes/templates/responsive_classic/templates/tpl_ajax_checkout_confirmation_default.php

That file didn't include the processing text, etc.

Slight clarification. It's not a mobile-specific issue.

When using a payment module that collects credit card numbers directly on your site, the store will use ajax to load the checkout-confirmation screen, instead of transmitting card data to/from your server. To do that it will load the tpl_ajax_checkout_confirmation_default.php instead of the usual tpl_checkout_confirmation_default.php.

So, yes, if you manually customize one of those files you should apply the same customizations to both equally.

6 Jan 2017, 7:25 PM
#34
lindasdd avatar

lindasdd

Zen Follower

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

Re: Order Confirmation Processing Block .. vs duplicate orders

DrByte:

Slight clarification. It's not a mobile-specific issue.

When using a payment module that collects credit card numbers directly on your site, the store will use ajax to load the checkout-confirmation screen, instead of transmitting card data to/from your server. To do that it will load the tpl_ajax_checkout_confirmation_default.php instead of the usual tpl_checkout_confirmation_default.php.

So, yes, if you manually customize one of those files you should apply the same customizations to both equally.

Ok, that makes sense. Only issue is that now the fix detailed here https://www.zen-cart.com/showthread.php?202300-eWAY-Payment-Gateway-Rapid-3-0-API-Support-Thread&p=1314200#post1314200

doesn't seem to work when applied to the tpl_ajax_checkout_confirmation_default.php file.

Is a different version of the code required? Does the Ajax file block Jscript from loading?

I am getting a console error of 'ReferenceError: submitonce is not defined' and referencing the checkout_payment page.

7 Jan 2017, 4:18 AM
#35
drbyte avatar

drbyte

Sensei

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

Re: Order Confirmation Processing Block .. vs duplicate orders

Oh ... ya, there's probably an issue there, since it's javascript/ajax that's loading the page in the first place, and it won't cause the extra javascript to run automatically ... and might not even be designed to properly pass thru javascript code without breaking the quotes. (Haven't looked at the code for that problem yet)