Skip to content

Commit ad51265

Browse files
committed
Merge pull request #5612 from pratikshad/CRM-16222
CRM-16222 Fix-Forms with 'Other amount' field should display a currency ...
2 parents 99145c0 + 2882b6a commit ad51265

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

CRM/Price/BAO/PriceField.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -320,22 +320,17 @@ public static function addQuickFormElement(
320320
));
321321

322322
$extra = array();
323-
if (!empty($qf->_quickConfig) && !empty($qf->_contributionAmount)) {
324-
foreach ($fieldOptions as &$fieldOption) {
325-
if ($fieldOption['name'] == 'other_amount') {
326-
$fieldOption['label'] = $fieldOption['label'] . ' ' . $currencySymbol;
327-
}
328-
}
329-
$qf->assign('priceset', $elementName);
330-
$extra = array('onclick' => 'useAmountOther();');
331-
}
332-
333323
if (!empty($qf->_membershipBlock) && !empty($qf->_quickConfig) && $field->name == 'other_amount' && empty($qf->_contributionAmount)) {
334324
$useRequired = 0;
335325
}
336326
elseif (!empty($fieldOptions[$optionKey]['label'])) {
337327
//check for label.
338328
$label = $fieldOptions[$optionKey]['label'];
329+
if (!empty($qf->_quickConfig) && !empty($qf->_contributionAmount) && strtolower($fieldOptions[$optionKey]['name']) == 'other_amount') {
330+
$label .= ' ' . $currencySymbol;
331+
$qf->assign('priceset', $elementName);
332+
$extra = array('onclick' => 'useAmountOther();');
333+
}
339334
}
340335

341336
$element = &$qf->add('text', $elementName, $label,

0 commit comments

Comments
 (0)