Fix for #214: Multiple autodiscounts only applies first discount.
Created by: kewljuice
I commented out: 'break;' so that the script loops all the auto discounts and uses the discount with the highest value.
Merge request reports
Activity
Created by: agh1
See comments at https://github.com/civicrm/org.civicrm.module.cividiscount/issues/214#issuecomment-582293735 and https://lab.civicrm.org/extensions/cividiscount/issues/1#note_24077 indicating that this change works.
For acceptance it would be better to delete the lines rather than commenting them out.
Created by: agh1
@kewljuice that looks a lot cleaner. However, I looked through the "blame" on the existing code, and it looks like that
break
was added by PR #171 which was looking to address issue #167 (closed). I'm concerned that you, @twomice, and @h-c-c might end up in a tug-of-war, so there may need to be a third solution to be sure that the applied discount is the counted one and the biggest autodiscount gets applied.Created by: freeform-sg
Hi there - we're in a similar situation in that we need two auto discounts applied, however, we're not looking for the highest valued one, we want both. In our case, each one is linked to different price fields so there is no overlap between the discounts. The first is for the main event fee, and the second for an optional workshop, and the options for each are in different price fields.
mentioned in merge request !271
Lots of PRs and issues looking at this problem, I've collected some thoughts in #303 (closed). Please provide feedback there.
Edited by larsssandergreenmentioned in commit eileen/cividiscount@a300cae5
mentioned in merge request !314 (merged)
I have put up an alternative to this here !314 (merged)
It doesn't address everything everyone wants - cos they seem to be in conflict - but it does seem to cover the thing that everyone agrees on - that the highest discount should apply