CRM-16064 fix - Contributions pricesets charge $1 more than selected
authormonishdeb <monish.deb@webaccessglobal.com>
Tue, 10 Mar 2015 06:11:27 +0000 (11:41 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Tue, 10 Mar 2015 06:11:27 +0000 (11:41 +0530)
https://issues.civicrm.org/jira/browse/CRM-16064

CRM/Contribute/Form/Contribution/Main.php

index 6ad81b805278d2acda600988afe25c53a73c25fe..19ebeb6bae0aa9109ca17b1e1b16bf97e9a0f80f 100644 (file)
@@ -1281,7 +1281,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
       $is_quick_config = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config');
       if ($is_quick_config) {
         foreach ($this->_values['fee'] as $key => & $val) {
-          if ($val['name'] == 'other_amount' && $val['html_type'] == 'Text' && array_key_exists('price_' . $key, $params)) {
+          if ($val['name'] == 'other_amount' && $val['html_type'] == 'Text' && !empty($params['price_' . $key])) {
             $params['price_' . $key] = CRM_Utils_Rule::cleanMoney($params['price_' . $key]); //Clean out any currency symbols
             if ($params['price_' . $key] != 0) {
               foreach ($val['options'] as $optionKey => & $options) {