diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 6d876ec942456370ab8719143ca8132c22ae3dea..11fd190048d6a1332720520af734e06a197f49d6 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -1354,9 +1354,8 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $form->assign('snippet', $form->_snippet); $paymentProcessors = $form->get('paymentProcessors'); - $form->assign('ppType', FALSE); $form->_ppType = NULL; - if (!empty($paymentProcessors)) { + if ($paymentProcessors) { // Fetch type during form post if (CRM_Utils_Array::value('hidden_processor', $_POST)) { $form->_ppType = CRM_Utils_Array::value('payment_processor', $_POST); @@ -1364,6 +1363,10 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $form->set('mode', $form->_mode); $form->set('paymentProcessor', $form->_paymentProcessor); } + // When user presses the back button + elseif (!empty($form->_submitValues)) { + $form->_ppType = CRM_Utils_Array::value('payment_processor', $form->_submitValues); + } // Fetch type during ajax request elseif (isset($_GET['type']) && $form->_snippet) { $form->_ppType = $_GET['type']; @@ -1377,7 +1380,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } } if ($form->_ppType) { - $form->assign('ppType', TRUE); CRM_Core_Payment_ProcessorForm::preProcess($form); } @@ -1390,6 +1392,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } } } + $form->assign('ppType', $form->_ppType); } } diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index 502dcfca8cba90ec757b48c67d45d0ff02d33a37..c1cf62401ad21498bc514ed349dcc1b9b37acca5 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -335,18 +335,6 @@ {/if} </div> -{* Hide Credit Card Block and Billing information if contribution is pay later. *} - {if $form.is_pay_later and $hidePaymentInformation} - {include file="CRM/common/showHideByFieldValue.tpl" - trigger_field_id ="is_pay_later" - trigger_value ="" - target_element_id ="billing-payment-block" - target_element_type ="table-row" - field_type ="radio" - invert = 1 - } - {/if} - <script type="text/javascript"> {if $pcp} pcpAnonymous();