From 19c22a58e48fed4c1669124a9c5b6a572d28b29a Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Fri, 4 Mar 2016 00:52:04 +0530 Subject: [PATCH] CRM-18118 fix --- CRM/Contribute/Form/Contribution/Main.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 7dd7574d28..a358db8036 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -1024,14 +1024,15 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu case 'membership_amount': $this->_params['selectMembership'] = $params['selectMembership'] = CRM_Utils_Array::value('membership_type_id', $priceOptions[$selectedPriceOptionID]); $this->set('selectMembership', $params['selectMembership']); - if (CRM_Utils_Array::value('is_separate_payment', $this->_membershipBlock) == 0) { - $this->_values['amount'] = CRM_Utils_Array::value('amount', $priceOptions[$selectedPriceOptionID]); - } - break; - case 'contribution_amount': + case 'contribution_amount': $params['amount'] = $selectedPriceOptionID; - $this->_values['amount'] = CRM_Utils_Array::value('amount', $priceOptions[$selectedPriceOptionID]); + if ($priceField->name == 'contribution_amount' || + ($priceField->name == 'membership_amount' && + CRM_Utils_Array::value('is_separate_payment', $this->_membershipBlock) == 0) + ) { + $this->_values['amount'] = CRM_Utils_Array::value('amount', $priceOptions[$selectedPriceOptionID]); + } $this->_values[$selectedPriceOptionID]['value'] = CRM_Utils_Array::value('amount', $priceOptions[$selectedPriceOptionID]); $this->_values[$selectedPriceOptionID]['label'] = CRM_Utils_Array::value('label', $priceOptions[$selectedPriceOptionID]); $this->_values[$selectedPriceOptionID]['amount_id'] = CRM_Utils_Array::value('id', $priceOptions[$selectedPriceOptionID]); @@ -1048,7 +1049,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } // from here on down, $params['amount'] holds a monetary value (or null) rather than an option ID $params['amount'] = self::computeAmount($params, $this->_values); - if (($this->_values['is_pay_later'] && empty($this->_paymentProcessor) && !array_key_exists('hidden_processor', $params)) || -- 2.25.1