Following updates to PHP 7.3.29 and MySQL 5.7.34 earlier this month, we discovered that discounts are no longer being automatically applied to event registration forms, public or back-end. The discount codes do work when applied manually. No errors are being logged. We just updated CiviDiscount to 3.8.2 from an older version, but that did not resolve the problem. We are on CiviCRM 5.33.5 on Drupal 7.81. Any ideas what might be causing this? Thanks very much.

  • might be worth seeing if you can replicate on dmaster.demo.civicrm.org
    – petednz - fuzion
    Jul 27 at 3:38
  • I did a test on demo and it worked fine. It is also on PHP 7.3.29. I wonder if some other extension we are using might be a factor.
    – Larry K.
    Jul 27 at 14:52
  • This appears of be a version compatibility issue, as price sets that were created before 2018 still display properly. If I copy or try to update an old price set, they stop displaying the discounts.
    – Larry K.
    Jul 29 at 16:32
  • 1
    I have submitted this as a possible issue with price sets: lab.civicrm.org/dev/core/-/issues/2727
    – Larry K.
    Jul 29 at 21:42

I was able to get this working with this reversal of logic in cividiscount.php: This seems to function properly on CiviDiscount 3.7 on our production server:

- if ($autodiscount) {
-        break;
+ if (!$autodiscount) {
+        continue;

We are still experiencing the puzzling issues mentioned below on our dev server with CiviDiscount 3.8.4. Hopefully someone familiar with the code will be able to work through this and determine what the issue is.

  • I am now noticing some additional strange behavior on our dev server with CiviDiscount 3.8.4. If I go to edit existing discounts from the last few years, the previously selected price sets in the Discounts for Events field are no longer displayed and price sets for events in the last few years no longer appear in the pick list and there are some blank lines instead. I rebooted the server just in case something was hung, and there is no change.
    – Larry K.
    Aug 3 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.