The settings on the discount code are
1. Discount: 20
2. Discount Type: Monetary
3. Usage: 0
4. Expires On: 01/05/2012 23:59
5. Not Specified: Organization, Automatic Discount
6. Upcoming Events: Event_11 (only one event selected)
7. Price Sets: Event_11_checkbox:: Choices:: fees
8. Not Specified: Memberships

The discount code works on the checkboxes of multiple participants.
But a test-drive of registering the event on 01/08/2012 still shows the discount code are NOT expired.

Should the settings of discount code or the event be changed?
If the fix exists, where can I download the patch?
Or, I can modify the logic in civievent_discount_civicrm_validate()?

Thanks for the great module.

Version: Drupal 6.22 CiviCRM 3.4.7

Comments

dharmatech’s picture

Assigned: Unassigned » dharmatech
Status: Active » Postponed (maintainer needs more info)

elmobile,

Thanks for the detailed bug report. Can you confirm expiration is working for you on discount codes not tied to a price set? I just want to make sure it's not something else related to your environment before digging in.

elmobile’s picture

Yes, the discount code works perfectly after I added expiration date check to the following function:

function civievent_discount_civicrm_validate(...) {
...
if ($code['count_max'] > 0) {
...
} else if (!is_null($code['expiration']) && $code['expiration'] != '0000-00-00 00:00:00') {
/*
print error message if the discount code expired
*/        }
...
}

This way we can set unlimited 'Early Bird' discounts.

Let us know when the general fix is available.

Thanks for the great module!

dharmatech’s picture

Status: Postponed (maintainer needs more info) » Active

I'll push a new -dev release tomorrow (Monday) w/the fix. Would be good if you can help test after the issue is updated.

dharmatech’s picture

Status: Active » Fixed

Fixed in latest -dev release. You may need to wait 24 hours for the update to appear.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.