Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DoubleSubmit Concerns #274

Closed
lindasdd opened this issue Oct 11, 2020 · 1 comment
Closed

DoubleSubmit Concerns #274

lindasdd opened this issue Oct 11, 2020 · 1 comment

Comments

@lindasdd
Copy link

lindasdd commented Oct 11, 2020

OPC utilizes the loading animation and 'doublesubmit/submitonce' function via the confirmation page.

The only problem with that (for me), is there is no such prevention on the actual order confirm/submit button.

The solution that worked for my exact needs was to do the following.

in includes\templates\YOUR_TEMPLATEE\templates\tpl_modules_opc_submit_block.php on line 22 I added the below pulled from the checkout_confirmation page:


')) . zen_image ($template->get_template_dir (CHECKOUT_ONE_CONFIRMATION_LOADING, DIR_WS_TEMPLATE, $current_page_base ,'images') . '/' . CHECKOUT_ONE_CONFIRMATION_LOADING, CHECKOUT_ONE_CONFIRMATION_LOADING_ALT); ?>

I also gave the button an id of 'opc-order-confirm-submit' (so that I could display/hide the button)

Then in includes\modules\pages\checkout_one\jquery.checkout_one.js I utilized the jQuery that is watching ajax start and stop:

jQuery(document).ajaxStart(function () {
jQuery('*').css('cursor', 'wait');
jQuery('#checkoutOneConfirmationLoading').show();
jQuery('#opc-order-confirm-submit').hide();
});

jQuery(document).ajaxStop(function () {
    jQuery('*').css('cursor', '');
    jQuery('#checkoutOneConfirmationLoading').hide();
    jQuery('#opc-order-confirm-submit').show();
});
@lat9 lat9 added the bug label Oct 26, 2020
@lat9 lat9 added this to the v2.3.5 milestone Oct 26, 2020
@lat9
Copy link
Owner

lat9 commented Oct 26, 2020

@lindasdd, I chose to correct the issue somewhat differently. See the changes submitted above to /includes/modules/pages/checkout_one/jquery.checkout_one.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants