From e85ea63078a33c11611bf6b0ca17dbf7067569bc Mon Sep 17 00:00:00 2001 From: Lola Slade Date: Thu, 1 May 2014 18:52:30 -0700 Subject: [PATCH] CRM-14568 - Billing payment block is not being loaded in Chrome. --- .../CRM/Event/Form/Registration/Register.tpl | 24 ++++++++++--------- templates/CRM/Price/Form/Calculate.tpl | 4 +++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/templates/CRM/Event/Form/Registration/Register.tpl b/templates/CRM/Event/Form/Registration/Register.tpl index 82a2cca782..fffb3fb22f 100644 --- a/templates/CRM/Event/Form/Registration/Register.tpl +++ b/templates/CRM/Event/Form/Registration/Register.tpl @@ -205,33 +205,35 @@ skipPaymentMethod(); }); + // Called from display() in Calculate.tpl, depends on display() having been called function skipPaymentMethod() { var symbol = '{/literal}{$currencySymbol}{literal}'; var isMultiple = '{/literal}{$event.is_multiple_registrations}{literal}'; var flag = 1; - if (isMultiple && cj("#additional_participants").val()) { + var payment_options = cj(".payment_options-group"); + var payment_processor = cj("div.payment_processor-section"); + var payment_information = cj("div#payment_information"); + + if ((isMultiple && cj("#additional_participants").val()) || + !(payment_options.length && payment_processor.length && payment_information.length)) { flag = 0; } if ((cj('#pricevalue').text() == symbol + " 0.00") && flag) { - cj(".payment_options-group").hide(); - cj("div.payment_processor-section").hide(); - cj("div#payment_information").hide(); + payment_options.hide(); + payment_processor.hide(); + payment_information.hide(); // also unset selected payment methods cj('input[name="payment_processor"]').removeProp('checked'); } else { - cj(".payment_options-group").show(); - cj("div.payment_processor-section").show(); - cj("div#payment_information").show(); + payment_options.show(); + payment_processor.show(); + payment_information.show(); } } - cj('#priceset input, #priceset select').change(function () { - skipPaymentMethod(); - }); - {/literal} {/if} diff --git a/templates/CRM/Price/Form/Calculate.tpl b/templates/CRM/Price/Form/Calculate.tpl index 4a1b6a9b47..bdb875ee4c 100644 --- a/templates/CRM/Price/Form/Calculate.tpl +++ b/templates/CRM/Price/Form/Calculate.tpl @@ -214,7 +214,9 @@ function display( totalfee ) { cj('#total_amount').val( totalfee ); ( totalfee < 0 ) ? cj('table#pricelabel').addClass('disabled') : cj('table#pricelabel').removeClass('disabled'); - + if (typeof skipPaymentMethod == 'function') { + skipPaymentMethod(); + } } {/literal} {/if} -- 2.25.1