skip for priceset total amount zero
authoryashodha <yashodha.chaku@webaccess.co.in>
Tue, 20 Aug 2013 10:56:52 +0000 (16:26 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Tue, 20 Aug 2013 10:56:52 +0000 (16:26 +0530)
templates/CRM/Event/Form/Registration/Register.tpl

index e506f6196202e0d4f84d2549822bdfee83501be9..8f15b2dfb2763d4d1a542334b8e588be8dc9a67a 100644 (file)
     });
 
     function skipPaymentMethod() {
-    cj('#priceset input').change(function() {
-      if (cj(this).attr('data-amount') == '0') {
-        cj(".payment_options-group").hide();
-        cj("div.payment_processor-section").hide();
-        cj("div#payment_information").hide();
-      } else {
-        cj(".payment_options-group").show();
-        cj("div.payment_processor-section").show();
-        cj("div#payment_information").show();
-      }
-
-    });
+      var symbol = '{/literal}{$currencySymbol}{literal}';
+      cj('#priceset input').change(function () {
+        if ((cj(this).attr('data-amount') == '0') || (cj('#pricevalue').text() == symbol + " 0.00" )) {
+          cj(".payment_options-group").hide();
+          cj("div.payment_processor-section").hide();
+          cj("div#payment_information").hide();
+        }
+        else {
+          cj(".payment_options-group").show();
+          cj("div.payment_processor-section").show();
+          cj("div#payment_information").show();
+        }
+
+      });
     }
     {/literal}
   </script>