However, is there a way to assign a quantity to this? So in your code, say cap ‘shipping fee’ so when one registrant has chosen that option, it is no longer available to other registrants?
In my case, I’m using this to build add-ons but said add-ons have limited availability and large $/£ values so don’t want to get sucked into issuing large refunds if registrants are adding-on something we no longer have available. Do this make sense?
This does make sense, however the code from the snippet does not include a way to assign a quantity, and actually it would require more than just assigning a quantity to make a question option no longer available. Something would also need to retrieve the number of times the chosen option has previously been selected. Then some additional logic to remove an option if no longer available.
So this could be possible but would require some significant development that would be in addition to the snippet you’re already using. One approach could be use the FHEE__EE_Question__generate_form_input__return filter hook to alter what’s available as an option (based on information from previous selections from other registrations already in the database).
This type of project will require the experience of a PHP developer that’s familiar with the WordPress plugin API and has a good grasp of object-oriented programming. Not every team has this, and when that’s the case we recommend contacting codeable.io, they have developers there that could do a project like this for a reasonable fee.
Viewing 1 reply thread
The support post ‘EE code snippet’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.