Don't require payment information for multiple participant event registration if all amounts are 0
Eg. you have a priceset with two or more line items. The discount code applies 100% discount to all lineitems.
Previous behaviour:
Payment information is shown if "how many people are you registering" is > 1.
New behaviour:
Payment information is shown if "how many people are you registering" is > 1 and any of the priceset lines have an amount > 0.
Implementation
When the discount is calculated some information about the details of the discount are set in CRM.vars.cividiscount
. A new javascript file (js/event.js) reads these variables and hides the payment block if all lineitems are 0.
By default CiviCRM does not do this because it doesn't know if all lineitems are 0. It assumes that if there are multiple participants that you might choose a paid option for one of the other participants. But if you have a 100% discount applied across all lineitems all participants will be free.