}
if ($self->_values['event']['is_monetary']) {
- if (($fields['amount'] > 0) && empty($fields['payment_processor'])) {
+ if (($fields['amount'] > 0) && (!isset($fields['payment_processor']) && $fields['payment_processor'] != 0 )) {
$errors['payment_processor'] = ts('Please select a Payment Method');
}
if (is_array($self->_paymentProcessor)) {
flag = 0;
}
- cj('#priceset input').change(function () {
- if (((cj(this).attr('data-amount') == 0) || (cj('#pricevalue').text() == symbol + " 0.00" )) && flag ) {
- 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();
- }
-
- });
+ if (((cj('#priceset input:checked').attr('data-amount') == 0) ||
+ (cj('#pricevalue').text() == symbol + " 0.00" )) && flag) {
+ cj(".payment_options-group").hide();
+ cj("div.payment_processor-section").hide();
+ cj("div#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();
+ }
}
+
+ cj('#priceset input').change(function () {
+ skipPaymentMethod();
+ });
+
{/literal}
</script>
{/if}