I want the user to be able to type a Discount code into a field and then I want that Discount code (if applied correctly) to result in a reduction of their Membership Fees;

2 Answers 2


This is easy to configure with webform civicrm (a Drupal module) - here are the steps:

A. Create a native webform field - call it Discount Code. Let's put it at the top - where we're going to select the Membership Type:

enter image description here

B. Go to your CiviCRM Tab -> then to Memberships -> and hit the checkbox on Membership Fee; this will expose it to the webform;

C. String it together with Conditionals: in your Webform Tab -> hit Conditionals Here's mine:enter image description here

D. Let's test the Form: here are the three scenarios:

Select Professional Membership - we don't have a Discount Code:

enter image description here

Select Student Membership - we don't have a Discount Code:

enter image description here

Select Student Membership - and we have a Discount Code:

enter image description here

  • Thoughts on using this to reduce the cost to a 'free' ($0) registration? I've tried it with conditionals, which does zero the fee, however I run into an issue when the webform is still wanting credit card info entered to complete the registration.
    – jursulak
    Apr 9, 2018 at 16:56
  • Hey Jason - email me the form url and I’ll have a look Apr 9, 2018 at 17:39
  • Thanks Karin. This actually makes CiviDiscount useless :-) Jan 9, 2020 at 17:19
  • Combine this with webform_calculator module and you’ll be flying :-) PS if you do - we have an improved version of it that does math over multiple forms. Ping me if you’re interested. Jan 10, 2020 at 0:24

Consider using the suggestion below from KarinG to manage a larger list of Discount codes effectively.

enter image description here

  • 1
    HI Zachary -> if you are on D9 you can use Computed TWIG fields. I've added an example to your Answer (because I can't include an image in a comment). Apr 11, 2023 at 0:15
  • 1
    Zach - as your post is not an Answer it will get deleted at some point. Please either ensure you post your 'question' as a comment or as a new question. or since i see karin helpfully added images as an answer, reword your 'question' so it becomes an Answer :-)
    – petednz - fuzion
    Apr 11, 2023 at 4:27
  • Thanks to both of you, brilliant.
    – Zachary
    Apr 11, 2023 at 19:08

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.