CRM-14568 - Billing payment block is not being loaded in Chrome.
authorLola Slade <lola@freeform.ca>
Fri, 2 May 2014 01:52:30 +0000 (18:52 -0700)
committerLola Slade <lola@freeform.ca>
Fri, 2 May 2014 01:52:30 +0000 (18:52 -0700)
templates/CRM/Event/Form/Registration/Register.tpl
templates/CRM/Price/Form/Calculate.tpl

index 82a2cca78230ac45a1557c4434a1136e899bd724..fffb3fb22f576ae5387693f9755091385318b616 100644 (file)
       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}
   </script>
 {/if}
index 4a1b6a9b4775116109818db4f0fe5d451f46e461..bdb875ee4c44c86526573417638676200b490fdf 100644 (file)
@@ -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}