Answers.Body: <p>I have been able to replicate the problem. With 3.8.3 and 3.8.4 I believe the issue is if there are multiple price sets with fields with the same labels. I replicated the issue using the following steps:</p>
  <ol>
  <li>Create a price set of type event, add multiple fields</li>
  <li>Duplicate the price set, without changing the labels of any of the fields</li>
  <li>Create an event and select the 1st price set</li>
  <li>Create a second event and select the 2nd price set</li>
  <li>Create a discount code and view the available price fields: for each price set you created only 1 field's options will be available (<a href="https://i.sstatic.net/KsVms.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KsVms.png" alt="Screenshot 1" /></a>)</li>
  <li>Edit the price fields for the 2nd price set and make sure all of the labels are unique from those in the 1st price set</li>
  <li>Attempt to create a discount code again and this time all price fields from both price sets should be available (<a href="https://i.sstatic.net/8dLPB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8dLPB.png" alt="Screenshot 2" /></a>)</li>
  </ol>
  <p>Another example; if you change the labels so that only 1 field label is not unique, then you will see:</p>
  <ul>
  <li>Price set 1 options: Only the field whose label is NOT unique</li>
  <li>Price set 2 options: Only the fields whose labels ARE unique
  (<a href="https://i.sstatic.net/Wy9X0.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Wy9X0.png" alt="Screenshot 3" /></a>)</li>
  </ul>
  <p><a href="https://github.com/civicrm/org.civicrm.module.cividiscount/issues/265" rel="nofollow noreferrer">I have created an issue over in GitHub</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-07T04:13:23.803Z
Answers.Text: I hope this problem is fixed soon, then, as I doubt I am the only one who needs to be able to reuse the same names. Ours are always Registrant and Early-Bird Registration.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-07T04:25:00.850Z
Answers.Text: I just changed all of mine to be unique. Still didn't change anything.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-07T04:42:47.497Z
Answers.Text: Ah, I think it is also running into an issue where it only looking at a certain number of characters to see if it's unique. I shortened everything and that didn't work. I shortened and moved the date to the beginning of the name - bingo! It worked.
Answers.UserDisplayName: Jenni Simonis
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-07T00:09:08.363Z
Answers.LastActivityDate: 2021-07-07T00:09:08.363Z
Answers.UserDisplayName: freeform.steph
Body: <p>We use discounts on our events so that we can do scholarships and such. We apply them to specific items in a price set, as they typically only apply to the regular price and not the early bird price. However, almost all the price sets have disappeared from the drop down inside the discount. All that is in the list are the textbook price sets. Each training should have 3 items - early bird reg, regular reg, and a textbook.</p>
  <p>We're running: CiviDiscount 3.8.4 and CiviCRM 5.38.0</p>
  <p><strong>First Update:</strong> I've been doing a lot of testing over the last 2 weeks. I've even tried upgrading a test copy to the beta (no change) and alpha (doesn't work - website error). So then I tried creating a new price set and attaching it to an event. It's not in the price set list in discounts. I tried uninstalling and reinstalling the discount extension. No change.</p>
  <p>I created another new price set and went super simple - just 1 item. That worked. Added the other option and the textbook - stopped working. Removed the textbook. Success!</p>
  <p>So I've gone through and manually recreated every price set without the textbook. At least one item from each price set shows up in the discounts. Now the problem is that only 1 out of 11 is showing both options (early bird and regular). EB is up to 30 days before the event, so almost every one of these has an active early bird discount.</p>
  <p>I tried copying the one price set that has both price options working, but the copy did the same thing - only one of the two shows in the options in discounts.</p>
  <p><strong>Second Update:</strong> So I tried the suggestion below and I made all my names unique. They still don't show up in the list. Screenshots added below. EGS is the only one showing up correctly and it's the only event of that type, so everything about it is unique.</p>
  <p><a href="https://i.sstatic.net/xbtUE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xbtUE.png" alt="Discount options" /></a>
  <a href="https://i.sstatic.net/ZKapP.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ZKapP.png" alt="Price set" /></a>
  <a href="https://i.sstatic.net/8JAv2.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8JAv2.png" alt="First price field" /></a>
  <a href="https://i.sstatic.net/2Ym43.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2Ym43.png" alt="Second price field" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-17T21:20:41.733Z
Comments.Text: can you replicate a similar but simpler set up on dmaster.demo.civicrm.org
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-17T21:28:17.253Z
Comments.Text: It worked on there without any problems.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-18T01:18:11.510Z
Comments.Text: you will only see the options that are valid for the date you are looking, what dates are early bird reg and regular reg actually set for?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-23T11:49:53.967Z
Comments.Text: I put up some screenshots that shows one of them. There's a whole list of EB and regular registrations that are in the future, as we have events scheduled through the end of the year. None of them show. The only item from the price sets that show are the textbook ones, which have no date on them.
  
  And we're not using the date options in the discounts, just the price set one.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-02T20:36:14.160Z
Comments.Text: We are also experiencing this issue CiviCRM 5.38.0 & CiviDiscount 3.8.4. It appears to be picking a single price field per price set to make available for selection. There appears to be no correlation with the expiry date of the price field, nor it's ID, it's like it's picking a random field per set.
Comments.UserDisplayName: freeform.steph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-02T20:45:34.830Z
Comments.Text: Yes, I've only been successful in getting one price set to show both fields. All others it's only one. I even duplicated that one and the duplicate only showed one field.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-02T20:55:57.897Z
Comments.Text: In regards to ptednz comment, "you will only see the options that are valid for the date you are looking", that appears to be entirely false. There is a price field available for every price set in the system, including price fields that have an end date several years in the past.
Comments.UserDisplayName: freeform.steph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-02T21:19:27.183Z
Comments.Text: @JenniSimonis the dmaster demo site appears to be having some difficulties and won't let me add a price set so I'm going to run some tests on a private test site, see if I can find some more info for reproducing the issue.
Comments.UserDisplayName: freeform.steph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-02T21:22:26.110Z
Comments.Text: Sounds good. That's how I narrowed things down thus far. But I hadn't had a chance yet to install a fresh site and try on there.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-02T22:50:45.623Z
Comments.Text: yes my comment was mis-applied in that i hadn't been thinking about Prices Sets in the Discount, as opposed to price sets for the event. my bad
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-03T08:57:23.797Z
Comments.Text: I installed a brand new Drupal site and installed Civi. It works in a brand new site. So it's looking like it gets messed up in the upgrade? Cause I even completely uninstalled the Discount extension and reinstalled it and the problem still existed. And there's no recognizable differences between the two fields in the database for fields.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-05T09:59:39.907Z
Comments.Text: Have you tried downgrading CiviDiscount to 3.8.1? Does it work in that version?
Comments.UserDisplayName: AlainB
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-06T19:08:24.527Z
Comments.Text: @AlainB - downgrading appears to have no effect, the issue remains after downgrading to 3.8.2 as well as 3.8.1
Comments.UserDisplayName: freeform.steph
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-07T00:02:41.450Z
Comments.Text: I'm going to try loading my backup on another server and see if I can narrow it down to the Civi upgrade or the extension upgrade.
Comments.UserDisplayName: Jenni Simonis
Tags: <price-sets><cividiscount>
Title: Discounts - Price Sets disappeared
ThreadText: # Discounts - Price Sets disappeared
  
  (Asked by: username_0 on 2021-06-17)
  
  We use discounts on our events so that we can do scholarships and such. We apply them to specific items in a price set, as they typically only apply to the regular price and not the early bird price. However, almost all the price sets have disappeared from the drop down inside the discount. All that is in the list are the textbook price sets. Each training should have 3 items - early bird reg, regular reg, and a textbook.
  
  We're running: CiviDiscount 3.8.4 and CiviCRM 5.38.0
  
  **First Update:** I've been doing a lot of testing over the last 2 weeks. I've even tried upgrading a test copy to the beta (no change) and alpha (doesn't work - website error). So then I tried creating a new price set and attaching it to an event. It's not in the price set list in discounts. I tried uninstalling and reinstalling the discount extension. No change.
  
  I created another new price set and went super simple - just 1 item. That worked. Added the other option and the textbook - stopped working. Removed the textbook. Success!
  
  So I've gone through and manually recreated every price set without the textbook. At least one item from each price set shows up in the discounts. Now the problem is that only 1 out of 11 is showing both options (early bird and regular). EB is up to 30 days before the event, so almost every one of these has an active early bird discount.
  
  I tried copying the one price set that has both price options working, but the copy did the same thing - only one of the two shows in the options in discounts.
  
  **Second Update:** So I tried the suggestion below and I made all my names unique. They still don't show up in the list. Screenshots added below. EGS is the only one showing up correctly and it's the only event of that type, so everything about it is unique.
  
  [![Discount options](https://i.sstatic.net/xbtUE.png)](https://i.sstatic.net/xbtUE.png)
  [![Price set](https://i.sstatic.net/ZKapP.png)](https://i.sstatic.net/ZKapP.png)
  [![First price field](https://i.sstatic.net/8JAv2.png)](https://i.sstatic.net/8JAv2.png)
  [![Second price field](https://i.sstatic.net/2Ym43.png)](https://i.sstatic.net/2Ym43.png)
  
  **Tags:** price-sets, cividiscount
  
  > **Comments:**
  > **username_1**: can you replicate a similar but simpler set up on dmaster.demo.civicrm.org  
  > **username_0**: It worked on there without any problems.  
  > **username_1**: you will only see the options that are valid for the date you are looking, what dates are early bird reg and regular reg actually set for?  
  > **username_0**: I put up some screenshots that shows one of them. There's a whole list of EB and regular registrations that are in the future, as we have events scheduled through the end of the year. None of them show. The only item from the price sets that show are the textbook ones, which have no date on them.  And we're not using the date options in the discounts, just the price set one.  
  > **username_2**: We are also experiencing this issue CiviCRM 5.38.0 & CiviDiscount 3.8.4. It appears to be picking a single price field per price set to make available for selection. There appears to be no correlation with the expiry date of the price field, nor it's ID, it's like it's picking a random field per set.  
  > **username_0**: Yes, I've only been successful in getting one price set to show both fields. All others it's only one. I even duplicated that one and the duplicate only showed one field.  
  > **username_2**: In regards to ptednz comment, "you will only see the options that are valid for the date you are looking", that appears to be entirely false. There is a price field available for every price set in the system, including price fields that have an end date several years in the past.  
  > **username_2**: @username_0 the dmaster demo site appears to be having some difficulties and won't let me add a price set so I'm going to run some tests on a private test site, see if I can find some more info for reproducing the issue.  
  > **username_0**: Sounds good. That's how I narrowed things down thus far. But I hadn't had a chance yet to install a fresh site and try on there.  
  > **username_1**: yes my comment was mis-applied in that i hadn't been thinking about Prices Sets in the Discount, as opposed to price sets for the event. my bad  
  > **username_0**: I installed a brand new Drupal site and installed Civi. It works in a brand new site. So it's looking like it gets messed up in the upgrade? Cause I even completely uninstalled the Discount extension and reinstalled it and the problem still existed. And there's no recognizable differences between the two fields in the database for fields.  
  > **username_3**: Have you tried downgrading CiviDiscount to 3.8.1? Does it work in that version?  
  > **username_2**: @username_3 - downgrading appears to have no effect, the issue remains after downgrading to 3.8.2 as well as 3.8.1  
  > **username_0**: I'm going to try loading my backup on another server and see if I can narrow it down to the Civi upgrade or the extension upgrade.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-07-07. Score: 4 | Accepted answer
  
  I have been able to replicate the problem. With 3.8.3 and 3.8.4 I believe the issue is if there are multiple price sets with fields with the same labels. I replicated the issue using the following steps:
  
  1. Create a price set of type event, add multiple fields
  2. Duplicate the price set, without changing the labels of any of the fields
  3. Create an event and select the 1st price set
  4. Create a second event and select the 2nd price set
  5. Create a discount code and view the available price fields: for each price set you created only 1 field's options will be available ([![Screenshot 1](https://i.sstatic.net/KsVms.png)](https://i.sstatic.net/KsVms.png))
  6. Edit the price fields for the 2nd price set and make sure all of the labels are unique from those in the 1st price set
  7. Attempt to create a discount code again and this time all price fields from both price sets should be available ([![Screenshot 2](https://i.sstatic.net/8dLPB.png)](https://i.sstatic.net/8dLPB.png))
  
  Another example; if you change the labels so that only 1 field label is not unique, then you will see:
  
  * Price set 1 options: Only the field whose label is NOT unique
  * Price set 2 options: Only the fields whose labels ARE unique
    ([![Screenshot 3](https://i.sstatic.net/Wy9X0.png)](https://i.sstatic.net/Wy9X0.png))
  
  [I have created an issue over in GitHub](https://github.com/civicrm/org.civicrm.module.cividiscount/issues/265)
  
  > **Comments:**
  > **username_0**: I hope this problem is fixed soon, then, as I doubt I am the only one who needs to be able to reuse the same names. Ours are always Registrant and Early-Bird Registration.  
  > **username_0**: I just changed all of mine to be unique. Still didn't change anything.  
  > **username_0**: Ah, I think it is also running into an issue where it only looking at a certain number of characters to see if it's unique. I shortened everything and that didn't work. I shortened and moved the date to the beginning of the name - bingo! It worked.  
  
  ---
  
  