1

I've enabled CiviDiscount and currently have it set up to offer member rates to a conference. However, it applies the member rate if the individual is a member at the time of registration.

Is there a way to apply the automatic discount after checking to see if the individual will be a member at the time of the event? That is, the end date of the membership must be after the event (or after a date of my choosing) in the CiviDiscount options. That way, if the individual's membership expires in between registration and the conference, they will need to renew their membership before registering for the conference.

EDIT: In terms of what I've tried, I have added "Membership" in the "Specify entity for advanced autodiscount" box and "{"end_date":{"$gt":"2017-02-05"}}" in the "Specify API string in the advanced filter" box. This causes the discount to fail to apply. When I blank those boxes, the discount applies correctly based on the test user's current membership (whose end date is in January 2017).

EDIT 2: I looked at the code on Github, and it looks like CiviDiscount is looking at the string using json_decode, so I changed the string to {"end_date":{">":"2017-02-17"}}. However, when looking at the form after saving it, the > is escaped to ">". I feel like that may be the problem, any advice would be appreciated.

1

Figured it out by manually editing the database and seeing how it was represented in the CiviCRM UI, so here's a guide in case anyone has the same need as me:

In order to automatically apply a discount if the contact has a membership that is active as of a specified date (example is February 18, 2017):

In the specify api string for advanced filter box, type {"end_date":{"\u003E":"2017-02-17"}}

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.