Apply autodiscount if multiple code satisfies the auto discount condi…
Changes included in this PR fixes the following usecase -
- Consider the below two discount codes which are applied to different price options but to the same event types.
eventmem20: $20 off for members discount is applied to event type
Fundraiserand to price field options $80, $100, etc.
eventmem35: $35 off for members discount is applied to event type
Fundraiserand to price field options $165, $400, etc.
The first price field $80, $100 is used in EventA and the second ($165, $400) is used in EventB.
When the registration page is loaded for EventA - the auto discount for
eventmem20is applied correctly.
When the registration page is loaded for EventB - the discount
eventmem35is not applied automatically.
CiviDiscount only grabs the first discount instance for the event type.