Skip to content

Fix discount calculation code not showing

bgm requested to merge github/fork/eileenmcnaughton/4.4 into master

Created by: eileenmcnaughton

Most of the time I spent on this was actually on thinking my fix wasn't working when it was because I was doing tests / looking for symptoms that were not going to happen because of these 3 things. The first 2 I think are non-regressive bugs whereas the third is a feature change that may need some thought

  1. if there are multiple valid discount codes per event they don't all work
  1. If you are using Text price values the label to the right does not update - making it appear the price field has not updated. The descriptive label does indicate the discount & it is reflected in the calculation (Option values are fine)

  2. The commit (not actually mine) that makes the price field discount work also means that you HAVE to apply a price field discount for it to work. I think it makes sense for it to default to all items rather than none if none are selected. (this is std Civi UI but we didn't do this in CiviDiscount due to outcome of our previous discussions - I can't actually recall the details) I suspect that this line is the place to look at this priceFields = isset(discount['pricesets']) ? $discount['pricesets'] : array();

Merge request reports

Loading