I would like to set up automatic discounts for a membership on an individual basis, so that each person's scholarship can be reflected on the membership payment page without any codes needed. It seems like this should be possible using perhaps the contact ID or something along those lines, but I haven't yet hit upon the correct setting for it. Is this possible, and if so, how would I go about doing it?

I'm using Drupal 7, CiviCRM 4.6.18, & CiviDiscount 3.2

3 Answers 3


I'm thinking:

  • store the scholarship amount into a custom field.

  • pull it up on the event registration (or contribution/membership) page and use a PHP hook to calculate the balance due.

  • this hook lives in a small extension and uses the civicrm_buildAmount hook - just like CiviDiscount does.


This is possible, but you need to know how to address the API using JSON. Also, if you select contacts by name, you're going to need a different discount per contact. Using a custom field might be better.

Also note that this requires that the person filling out the contribution form be logged in!

Attached please find an example of a CiviDiscount configuration that gives a 50% discount to anyone with a last name of "Smith". Check out the API Explorer if you need help with field names or syntax.

enter image description here

  • That's very cool but I think Naomi may be looking for a balance calculation Jul 4, 2016 at 12:26

You can accomplish this using the webform-civicrm module. Simple enable 'existing user' for contact 1 in your form and use conditionals to define the price field based on the contact name.

  • 1
    This will work if the number of Contacts to consider a discount for is small - else you'd have to deal with a truckload of conditionals Jul 4, 2016 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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