Posted: September 21, 2018 at 3:52 pm
I would like to replace the ticket information for a specific ticket with text once a user has purchased (x) tickets. The next time they log in they would still see the replacement text. So I have to check to see if they have the ticket(s), then provide else text. I can’t use capabilities as they will be buying tickets in the future. Can you point me in the right direction. Thank you. |
|
Hi there, Whilst we don’t support customizations, we can help point you in the right direction. When you say the ticket information, where do you want to change this? It sounds like you may be trying to prevent registrations on a specific ticket after X amount ticket registrations, is that right? |
|
September 24, 2018 at 10:26 am It sounds like you may be trying to prevent registrations on a specific ticket after X amount ticket registrations, is that right? Correct. See https://ibb.co/dmcT1p . I have already hidden the member ticket based on membership level (PMP Pro) I’m thinking I should be able to do the same if I can connect ticket to user? |
|
September 24, 2018 at 11:55 am Hi, I can point you in the direction of using a one-time capability for that ticket. Here’s a link to instructions on how to set this up: https://gist.github.com/joshfeck/51c2ef122616b48cc4846b1f44384859 |
|
September 24, 2018 at 12:35 pm Ok, That makes sense now that I think of it. I had thought of each ticket as being the same (in general terms they are the same kind) when in fact they are completely different; different dates. So now I have to add a unique code for each unique event ticket, add it the permissions for each role, add it to each ticket and then when the ticket is registered it removes that capability. That works for one ticket type where I want to remove the ticket after a single registration/purchase but I want the user to also be able to purchase up to 10 guest tickets which can be purchase one at a time; I cannot have the capability removed for that ticket (until (10) sold for example. Also how do I replace the ticket information with text when the capability is removed. Thank you for your help and patience. |
|
September 24, 2018 at 12:59 pm Hi, The specification to keep track of up to 10 guest tickets makes for a very tricky problem to solve. Is there a PHP developer on your team that can put together a way to track those? One way that could be done is track that via the user_meta. That would need to be custom coded. The ticket information will automatically show text informing them the ticket isn’t available. That text can be customized via the |
|
I can resolve the guest tickets. To be clear on removing the one-time capability; I have to run the function for each individual ticket? Thank you. |
|
I’m not sure I understand your question. Which function? Do you mean the |
|
Yes. But if I have 4 unique tickets, each with it’s own “capability” code, I will have to account for each one in the function?
|
|
To clarify I cannot use a single capability code as each ticket is offered at different events. The members have access to multiple events. |
|
September 25, 2018 at 11:12 am You can use something like this function: https://gist.github.com/Pebblo/25cab2c24fe28b0c65285b15f0e25104#file-example-multiple-caps-php What that does is check if the ticket has a capability that contains the text ‘has_unique_invitation_code’ set on it, if it does, it removes that capability from the user. So if you had each ticket setup like so: Ticket 1 has When the user registers onto Ticket 1 If they register onto both tickets in a single registration, both capabilities are removed. Is that what you are looking for? Note that you still need to add those individual capabilities to the users and if you want to use a different text string to search for on your caps, you can change the string HERE |
|
September 25, 2018 at 12:56 pm Yes that’s exactly what I meant. I’m going to implement that:
My only concern is if they cancel their ticket registration, and I know it’s going to happen. I will have to manually add that capability back to that user, or register them manually. Not clear on what you mean:
Thank you, a great help. |
|
Well, the capability you are looking for is, for example, My code wont work for you as it looks for a capability with the string So you’d need to change line 32 From To something like:
That’s correct, we don’t have any example code to do that for you currently. |
|
The support post ‘Replace ticket information for a specific ticket after purchased’ 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.