From c5174a1dbe8f0d8979a9d480576371072930858e Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 28 Jan 2024 09:04:39 +1300 Subject: [PATCH] Ensure total is always updated when other amount is selected --- CRM/Price/BAO/PriceField.php | 4 +++ .../CRM/Contribute/Form/Contribution/Main.tpl | 36 +++++++++---------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index a161fae726..38629f0f03 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -389,6 +389,8 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { 'price' => json_encode([$elementName, '0|0']), 'data-currency' => $currencyName, 'onclick' => 'clearAmountOther();', + 'data-amount' => 0, + 'data-is-null-option' => TRUE, ]; } @@ -408,6 +410,8 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { $choiceAttrs['0'] = [ 'price' => json_encode([$elementName, '0']), 'data-membership-type-id' => NULL, + 'data-amount' => 0, + 'data-is-null-option' => TRUE, ] + $incomingExtra; } diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index 054776ad3d..b516313aea 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -16,31 +16,29 @@ {literal} -- 2.25.1