Skip to content

Commit

Permalink
Merge pull request civicrm#7 from yashodha/events-hidepayment
Browse files Browse the repository at this point in the history
CRM-19931 - Payment block is not hidden if fee level with amount zero…
  • Loading branch information
sunilpawar authored Jan 27, 2017
2 parents e5f21e8 + 07c7584 commit 5cd0029
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions templates/CRM/Event/Form/Registration/Register.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@
}
}
cj('input[name^="price_"]').on('change', function () {
skipPaymentMethod();
});
cj('input[name="payment_processor"]').change(function () {
toggleConfirmButton();
});
Expand All @@ -219,11 +223,18 @@
// Called from display() in Calculate.tpl, depends on display() having been called.
function skipPaymentMethod() {
// If we're in quick-config price set, we do not have the pricevalue hidden element, so just return.
if (cj('#pricevalue').length == 0) {
var quickConfig = "{/literal}{$quickConfig}{literal}";
if (quickConfig) {
currentTotal = cj('input[name^=price_]:checked').data('amount');
}
else if (cj('#pricevalue').length == 0) {
return;
}
// CRM-15433 Remove currency symbol, decimal separator so we can check for zero numeric total regardless of localization.
currentTotal = cj('#pricevalue').text().replace(/[^\/\d]/g,'');
else {
// CRM-15433 Remove currency symbol, decimal separator so we can check for zero numeric total regardless of localization.
currentTotal = cj('#pricevalue').text().replace(/[^\/\d]/g,'');
}
var isMultiple = '{/literal}{$event.is_multiple_registrations}{literal}';
var flag = 1;
Expand Down

0 comments on commit 5cd0029

Please sign in to comment.