Answers.Body: <p>This is easy to configure with webform civicrm (a Drupal module) - here are the steps:</p>
  
  <p><strong>A. Create a native webform field - call it Discount Code.</strong> Let's put it at the top - where we're going to select the Membership Type:</p>
  
  <p><a href="https://i.sstatic.net/S1Mqp.png" rel="noreferrer"><img src="https://i.sstatic.net/S1Mqp.png" alt="enter image description here"></a></p>
  
  <p><strong>B. Go to your CiviCRM Tab -> then to Memberships -> and hit the checkbox on Membership Fee;</strong> this will expose it to the webform;</p>
  
  <p><strong>C. String it together with Conditionals:</strong> in your Webform Tab -> hit Conditionals
  Here's mine:<a href="https://i.sstatic.net/K0L8j.png" rel="noreferrer"><img src="https://i.sstatic.net/K0L8j.png" alt="enter image description here"></a></p>
  
  <p><strong>D. Let's test the Form:</strong> here are the three scenarios:</p>
  
  <p><strong>Select Professional Membership - we don't have a Discount Code:</strong></p>
  
  <p><a href="https://i.sstatic.net/s93cW.png" rel="noreferrer"><img src="https://i.sstatic.net/s93cW.png" alt="enter image description here"></a></p>
  
  <p><strong>Select Student Membership - we don't have a Discount Code:</strong></p>
  
  <p><a href="https://i.sstatic.net/ZleeY.png" rel="noreferrer"><img src="https://i.sstatic.net/ZleeY.png" alt="enter image description here"></a></p>
  
  <p><strong>Select Student Membership - and we have a Discount Code:</strong></p>
  
  <p><a href="https://i.sstatic.net/RJixh.png" rel="noreferrer"><img src="https://i.sstatic.net/RJixh.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-09T16:56:18.170Z
Answers.Text: 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.
Answers.UserDisplayName: jursulak
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-09T17:39:26.900Z
Answers.Text: Hey Jason - email me the form url and I’ll have a look
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-09T17:19:27.227Z
Answers.Text: Thanks Karin. This actually makes CiviDiscount useless :-)
Answers.UserDisplayName: Guillaume Sorel
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-10T00:24:16.560Z
Answers.Text: 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.
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-03T19:55:16.587Z
Answers.LastActivityDate: 2017-10-11T13:26:03.403Z
Answers.LastEditDate: 2017-10-11T13:26:03.403Z
Answers.UserDisplayName: KarinG - Semper IT
Answers.Body: <p>Consider using the suggestion below from KarinG to manage a larger list of Discount codes effectively.</p>
  <p><a href="https://i.sstatic.net/TeWDm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/TeWDm.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-11T00:15:24.583Z
Answers.Text: 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).
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-11T04:27:55.320Z
Answers.Text: 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 :-)
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-11T19:08:13.533Z
Answers.Text: Thanks to both of you, brilliant.
Answers.UserDisplayName: Zachary
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-10T20:33:26.100Z
Answers.LastActivityDate: 2023-04-11T19:08:00.143Z
Answers.LastEditDate: 2023-04-11T19:08:00.143Z
Answers.UserDisplayName: Zachary
Body: <p>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;</p>
  
Tags: <webform-civicrm><cividiscount><discounts>
Title: How can I emulate a CiviDiscount when using Webform CiviCRM?
ThreadText: # How can I emulate a CiviDiscount when using Webform CiviCRM?
  
  (Asked by: username_0 on 2017-10-03)
  
  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;
  
  **Tags:** webform-civicrm, cividiscount, discounts
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-10-03. Score: 13 | Accepted answer
  
  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](https://i.sstatic.net/S1Mqp.png)](https://i.sstatic.net/S1Mqp.png)
  
  **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](https://i.sstatic.net/K0L8j.png)](https://i.sstatic.net/K0L8j.png)
  
  **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](https://i.sstatic.net/s93cW.png)](https://i.sstatic.net/s93cW.png)
  
  **Select Student Membership - we don't have a Discount Code:**
  
  [![enter image description here](https://i.sstatic.net/ZleeY.png)](https://i.sstatic.net/ZleeY.png)
  
  **Select Student Membership - and we have a Discount Code:**
  
  [![enter image description here](https://i.sstatic.net/RJixh.png)](https://i.sstatic.net/RJixh.png)
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_0**: Hey Jason - email me the form url and I’ll have a look  
  > **username_2**: Thanks Karin. This actually makes CiviDiscount useless :-)  
  > **username_0**: 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.  
  
  ---
  
  ### Answer by username_3 on 2023-04-10. Score: 1
  
  Consider using the suggestion below from KarinG to manage a larger list of Discount codes effectively.
  
  [![enter image description here](https://i.sstatic.net/TeWDm.png)](https://i.sstatic.net/TeWDm.png)
  
  > **Comments:**
  > **username_0**: HI username_3 -> 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).  
  > **username_4**: 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 :-)  
  > **username_3**: Thanks to both of you, brilliant.  
  
  ---
  
  