Commit 38338938 authored by Monish Deb's avatar Monish Deb

Merge pull request #7995 from monishdeb/CRM-18071

Crm 18071
parents 727ecbcb 036c6315
......@@ -1595,6 +1595,18 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
// This feels like a bizarre hack as the variable name doesn't seem to be directly connected to it's use in the template.
$emailValues['useForMember'] = 0;
$emailValues['amount'] = 0;
//CRM-18071, where on selecting $0 free membership payment section got hidden and
// also it reset any payment processor selection result into pending free membership
// so its a kind of hack to complete free membership at this point since there is no $form->_paymentProcessor info
if (empty($form->_params['is_pay_later']) && !empty($membershipContribution) && !is_a($membershipContribution, 'CRM_Core_Error')) {
$paymentProcessorIDs = explode(CRM_Core_DAO::VALUE_SEPARATOR, CRM_Utils_Array::value('payment_processor', $this->_values));
if (empty($form->_paymentProcessor) && !empty($paymentProcessorIDs)) {
$this->_paymentProcessor['id'] = $paymentProcessorIDs[0];
}
$result = array('payment_status_id' => 1, 'contribution' => $membershipContribution);
$this->completeTransaction($result, $result['contribution']->id);
}
}
CRM_Contribute_BAO_ContributionPage::sendMail($contactID,
......@@ -1913,7 +1925,7 @@ class CRM_Contribute_Form_Contribution_Confirm extends CRM_Contribute_Form_Contr
// (note it might make sense to make this a row in the processor table in the db).
$this->_params['payment_processor_id'] = 0;
}
if (isset($this->_params['payment_processor_id']) && $this->_params['payment_processor_id'] == 0) {
if (isset($this->_params['payment_processor_id']) && $this->_params['payment_processor_id'] === 0) {
$this->_params['is_pay_later'] = $isPayLater = TRUE;
}
// add a description field at the very beginning
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment