From 79b237f9c13908b762cce245fedd0df8514c571e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 11 Aug 2015 10:29:06 -0400 Subject: [PATCH] CRM-16809 - Hide contribution submit buttons for paypal express --- templates/CRM/Financial/Form/PaypalExpress.tpl | 8 ++++++++ templates/CRM/common/paymentBlock.tpl | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/templates/CRM/Financial/Form/PaypalExpress.tpl b/templates/CRM/Financial/Form/PaypalExpress.tpl index dc1510d73b..1f8f4853bb 100644 --- a/templates/CRM/Financial/Form/PaypalExpress.tpl +++ b/templates/CRM/Financial/Form/PaypalExpress.tpl @@ -43,3 +43,11 @@ +{literal} + +{/literal} diff --git a/templates/CRM/common/paymentBlock.tpl b/templates/CRM/common/paymentBlock.tpl index 7ee0301ed3..b46276c2db 100644 --- a/templates/CRM/common/paymentBlock.tpl +++ b/templates/CRM/common/paymentBlock.tpl @@ -28,6 +28,8 @@ CRM.$(function($) { function buildPaymentBlock(type) { + var $form = $('#billing-payment-block').closest('form'); + {/literal}{if !$isBillingAddressRequiredForPayLater}{literal} if (type == 0) { $("#billing-payment-block").html(''); @@ -49,6 +51,9 @@ var dataUrl = "{crmURL p='civicrm/payment/form' h=0 q="`$urlPathVar``$contributionPageID`processor_id="}" + type; {literal} + // Processors like pp-express will hide the form submit buttons, so re-show them when switching + $('.crm-submit-buttons', $form).show().find('input').prop('disabled', true); + CRM.loadPage(dataUrl, {target: '#billing-payment-block'}); } @@ -56,6 +61,9 @@ $('[name=payment_processor_id]').on('change.paymentBlock', function() { buildPaymentBlock($(this).val()); }); + $('#billing-payment-block').on('crmLoad', function() { + $('.crm-submit-buttons input').prop('disabled', false); + }) }); -- 2.25.1