From 49d77b7f68cb4e12a7bdb2a1a711e54ea2655b19 Mon Sep 17 00:00:00 2001 From: Nathan Brettell Date: Mon, 31 Oct 2016 12:42:32 +0000 Subject: [PATCH] Contribution amount when set to 0 hides payment block --- templates/CRM/Contribute/Form/Contribution/Main.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index ce004f50d4..ab700a03ae 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -500,8 +500,10 @@ flag = true; } }); + priceSetTotal = currentTotal; cj('.price-set-option-content input, .other_amount-content input').on('input', function () { - currentTotal = cj(this).is('[data-amount]') ? cj(this).attr('data-amount').replace(/[^\/\d]/g,'') : (cj(this).val() ? cj(this).val() : 0); + currentTotal = cj(this).is('[data-amount]') ? cj(this).attr('data-amount').replace(/[^\/\d]/g,'') : (cj(this).val() ? cj(this).val().replace(/[^\/\d]/g : 0); + currentTotal = currentTotal + priceSetTotal; if (currentTotal == 0 ) { flag = true; } else { -- 2.25.1