From 2975161be094001e5304163f1d4bad132d572768 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 11 Nov 2015 19:50:53 -0800 Subject: [PATCH] CRM-16929 rework calculate tpl to be more robust and generic This makes is so that the data value 'line_raw_total' is (hopefully accurately) calculated on every price field value including 'quickConfig' and 'no thanks' options and the data value 'raw_total' for the priceset is the sum of these --- CRM/Price/BAO/PriceField.php | 2 + .../CRM/Contribute/Form/Contribution/Main.tpl | 5 +- templates/CRM/Price/Form/Calculate.tpl | 211 ++++++++---------- 3 files changed, 99 insertions(+), 119 deletions(-) diff --git a/CRM/Price/BAO/PriceField.php b/CRM/Price/BAO/PriceField.php index b49793d884..b15df0b3b4 100644 --- a/CRM/Price/BAO/PriceField.php +++ b/CRM/Price/BAO/PriceField.php @@ -430,6 +430,8 @@ class CRM_Price_BAO_PriceField extends CRM_Price_DAO_PriceField { if (!empty($qf->_membershipBlock) && $field->name == 'contribution_amount') { $choice[] = $qf->createElement('radio', NULL, '', ts('No thank you'), '-1', array( + 'price' => json_encode(array($elementName, '0|0')), + 'data-currency' => $currencyName, 'onclick' => 'clearAmountOther();', ) ); diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index eca12113c3..3c5bde6c99 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -253,10 +253,7 @@ {/if}
- {* If we have a payment processor, load it - otherwise it happens via ajax *} - {if $paymentProcessorID or $isBillingAddressRequiredForPayLater} - {include file="CRM/Financial/Form/Payment.tpl" snippet=4} - {/if} + {include file="CRM/Financial/Form/Payment.tpl" snippet=4}
{include file="CRM/common/paymentBlock.tpl"} diff --git a/templates/CRM/Price/Form/Calculate.tpl b/templates/CRM/Price/Form/Calculate.tpl index f460ee7864..1f0c9de8b1 100644 --- a/templates/CRM/Price/Form/Calculate.tpl +++ b/templates/CRM/Price/Form/Calculate.tpl @@ -42,168 +42,151 @@