Apply autodiscount if multiple code satisfies the auto discount condi…
…tion
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
Fundraiser
and to price field options $80, $100, etc. -
eventmem35: $35 off for members discount is applied to event type
Fundraiser
and 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
eventmem20
is applied correctly. -
When the registration page is loaded for EventB - the discount
eventmem35
is not applied automatically.
CiviDiscount only grabs the first discount instance for the event type.
Edited by bgm