Prevent checkout being submitted twice

This commit is contained in:
Mike Jolley 2011-11-16 09:38:04 +00:00
parent 96272f0e48
commit b23338c2b0
4 changed files with 9 additions and 3 deletions

View File

@ -549,7 +549,10 @@ jQuery(document).ready(function($) {
/* AJAX Form Submission */
$('form.checkout').submit(function(){
var form = this;
$(form).block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6}});
if ($(form).is('.processing')) return false;
$(form).addClass('processing').block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.plugin_url + '/assets/images/ajax-loader.gif) no-repeat center', opacity: 0.6}});
$.ajax({
type: 'POST',
url: woocommerce_params.checkout_url,
@ -562,7 +565,7 @@ jQuery(document).ready(function($) {
}
catch(err) {
$(form).prepend( code );
$(form).unblock();
$(form).removeClass('processing').unblock();
$('html, body').animate({
scrollTop: ($('form.checkout').offset().top - 100)

File diff suppressed because one or more lines are too long

View File

@ -98,6 +98,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
* Added logger class for debugging
* Ability to make layered nav an "OR" query so you can expand your search rather than filter it
* Tweaked coupon logic. Excluded coupons (for product discounts) don't get a product discount, but valid products do
* Prevent checkout being submitted twice
= 1.2.1 - 10/11/2011 =
* Reworked downloadable and virtual products - now variations can be downloadable/virtual too making it more flexible

View File

@ -150,6 +150,8 @@
<?php do_action( 'woocommerce_review_order_after_submit' ); ?>
</div>
<div class="clear"></div>
</div>