Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save incrize/83ede7b0316bffcbcf11 to your computer and use it in GitHub Desktop.
Save incrize/83ede7b0316bffcbcf11 to your computer and use it in GitHub Desktop.
diff --git a/design/themes/basic/templates/views/checkout/components/payments/payment_methods.tpl b/design/themes/basic/templates/views/checkout/components/payments/payment_methods.tpl
index 578aef4..7df29fa 100644
--- a/design/themes/basic/templates/views/checkout/components/payments/payment_methods.tpl
+++ b/design/themes/basic/templates/views/checkout/components/payments/payment_methods.tpl
@@ -12,12 +12,21 @@
<script type="text/javascript">
(function(_, $) {
$(_.doc).on('click', '.cm-select-payment', function() {
- var self = $(this);
+ var self = $(this),
+ form = self.parents('form');
- $.ceAjax('request', fn_url('{$url}&payment_id=' + self.val()), {
+ form.on('submit.select_payment', function() {
+ return false;
+ });
+
+ var jqxhr = $.ceAjax('request', fn_url('{$url}&payment_id=' + self.val()), {
result_ids: '{$result_ids}',
full_render: true
});
+
+ jqxhr.always(function() {
+ form.off('submit.select_payment');
+ });
});
}(Tygh, Tygh.$));
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment