Payment Method hidden / unchecked incorrectly
Created by: gareth-circle
main.js file "overwrites" the functionality of Civi JS functions showHidePayment and skipPaymentMethod.
I'm not sure they act as intended, or they don't in my scenario which I don't thinks is that unusual.
The cividiscount skipPaymentMethod() function checks to see if the value of a checked priceset is zero, if so, it hides the payment processor / Payment Method section and unchecks the radio option within.
In my situation, I have multiple pricesets so each one does not reflect the actual current total. When I select one of the pricesets that has a zero value the payment method section is hidden and option unset, therefore Civi displays errors saying you need to select a Payment Method, but you can't because it is hidden. If I comment out the entire main.js file everything seems to work as expected.
In the skipPaymentMethod() function within Civi (4.6 anyway), it considers the current total from the 'pricevalue' field, if available, rather than the price set value selected. Is it possible this needs to be worked into your code?
I've also noticed that the main.js file starts with "if ($('#discountcode').length > 0)", is that just to see if the discount field is on the page, or if the discount field has something in it? If the latter it doesn't seem correct and maybe requires .val or similar?