Skip to content

Commit

Permalink
Completely removing the submit button when the request is loading.
Browse files Browse the repository at this point in the history
This was causing issues where transactions were started double.
  • Loading branch information
Andy Pieters committed Mar 7, 2017
1 parent bf02e7e commit 54ac157
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions catalog/view/theme/default/template/payment/paynl3.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@
data: data,
type: 'POST',
beforeSend: function() {
$('#button-confirm').attr('disabled', true);
<?php if (substr(VERSION, 0, 3) == '1.4') { ?>
$('#paynl_payment').before('<div class="wait"><img src="catalog/view/theme/default/image/loading_1.gif" alt="" />Betaling wordt gestart</div>');
<?php } else { ?>
$('#paynl_payment').before('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" />Betaling wordt gestart</div>');
<?php } ?>
$('#button-confirm').remove();
<?php if (substr(VERSION, 0, 3) == '1.4') { ?>
$('#paynl_payment').before('<div class="wait"><img src="catalog/view/theme/default/image/loading_1.gif" alt="" />Betaling wordt gestart</div>');
<?php } else { ?>
$('#paynl_payment').before('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" />Betaling wordt gestart</div>');
<?php } ?>
},
success: function(json) {
if (json['error']) {
<?php if (substr(VERSION, 0, 3) == '1.4') { ?>
<?php if (substr(VERSION, 0, 3) == '1.4') { ?>
$('.wait').remove();
<?php } else { ?>
<?php } else { ?>
$('.attention').remove();
<?php } ?>
alert(json['error']);
$('#button-confirm').attr('disabled', false);
<?php } ?>
alert(json['error']);
}
if (json['success']) {
location = json['success'];
Expand Down

0 comments on commit 54ac157

Please sign in to comment.