Answers.Body: <p>Looks like there is in fact a bug here. I was able to recreate it by adding a required radio price field with only one option and a second price field with multiple options. If the required field has more than one option, then the bug doesn't occur.</p>
  <p>Please post an issue on CiviDiscount: <a href="https://lab.civicrm.org/extensions/cividiscount/-/issues/" rel="nofollow noreferrer">https://lab.civicrm.org/extensions/cividiscount/-/issues/</a></p>
  <p>If you're able to work on a fix, that's even better.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-10T15:12:34.313Z
Answers.Text: Thank you for confirming! I have posted this issue as noted above and we're working on this as well...
Answers.UserDisplayName: Jennifer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-10T14:36:12.987Z
Answers.LastActivityDate: 2023-08-10T14:36:12.987Z
Answers.UserDisplayName: Lars SG
Body: <p>I have set up a discount to apply 100% of the price to <em><strong>specific Price Fields</strong></em> from my Price Set, however, the discount is applied to all lines.
  We have tried editing the Discount to a specific amount instead of a %, and the result is the same.</p>
  <p>Currently using CiviCRM v 5.58.1 and CiviDiscount v 3.8.8</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-09T23:29:05.160Z
Comments.Text: Is it a discount that you enter the code for or an autodiscount?
  Is this a price set for an event?
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-09T23:30:18.157Z
Comments.Text: Seems to be working on dmaster with a code, you can check it right now at https://dmaster.demo.civicrm.org/ using the Fall Fundraiser Dinner event and code fnjqlw8fj
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-10T13:21:04.937Z
Comments.Text: @LarsSG, yes, this is a code used applicable to only 2 of the 3 price fields in the Price Set designated for this event.
Comments.UserDisplayName: Jennifer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-08-10T13:33:12.417Z
Comments.Text: @LarsSG, thank you for sharing this event, however, not quite the same. The Price set field I am using has one mandatory price field and an additional optional price field (there is at least one charge, with the optional second). In this case, we've chosen (in the setup) to apply the discount code to the mandatory field only, but is being applied to both.  See here: https://licony.org/index.php?option=com_civicrm&task=civicrm/event/register&id=68&reset=1.   Code: AMPCFREE23
Comments.UserDisplayName: Jennifer
Tags: <civievent><price-sets><cividiscount><discounts><percentage-price-field>
Title: Discount Code Applies to ALL lines, vs. the specified line in the Price Set Field
ThreadText: # Discount Code Applies to ALL lines, vs. the specified line in the Price Set Field
  
  (Asked by: username_0 on 2023-08-09)
  
  I have set up a discount to apply 100% of the price to ***specific Price Fields*** from my Price Set, however, the discount is applied to all lines.
  We have tried editing the Discount to a specific amount instead of a %, and the result is the same.
  
  Currently using CiviCRM v 5.58.1 and CiviDiscount v 3.8.8
  
  **Tags:** civievent, price-sets, cividiscount, discounts, percentage-price-field
  
  > **Comments:**
  > **username_1**: Is it a discount that you enter the code for or an autodiscount? Is this a price set for an event?  
  > **username_1**: Seems to be working on dmaster with a code, you can check it right now at https://dmaster.demo.civicrm.org/ using the Fall Fundraiser Dinner event and code fnjqlw8fj  
  > **username_0**: @LarsSG, yes, this is a code used applicable to only 2 of the 3 price fields in the Price Set designated for this event.  
  > **username_0**: @LarsSG, thank you for sharing this event, however, not quite the same. The Price set field I am using has one mandatory price field and an additional optional price field (there is at least one charge, with the optional second). In this case, we've chosen (in the setup) to apply the discount code to the mandatory field only, but is being applied to both.  See here: https://licony.org/index.php?option=com_civicrm&task=civicrm/event/register&id=68&reset=1.   Code: AMPCFREE23  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-08-10. Score: 0
  
  Looks like there is in fact a bug here. I was able to recreate it by adding a required radio price field with only one option and a second price field with multiple options. If the required field has more than one option, then the bug doesn't occur.
  
  Please post an issue on CiviDiscount: <https://lab.civicrm.org/extensions/cividiscount/-/issues/>
  
  If you're able to work on a fix, that's even better.
  
  > **Comments:**
  > **username_0**: Thank you for confirming! I have posted this issue as noted above and we're working on this as well...  
  
  ---
  
  