Home › Forums › Ticket Products › Event Tickets Plus › Shared capacity for tickets in database
- This topic has 8 replies, 2 voices, and was last updated 6 years, 3 months ago by Ilkka.
-
AuthorPosts
-
January 5, 2018 at 2:45 am #1418643IlkkaParticipant
Hi,
Ia m working on large amount of tickets and i have to be updating some information through database to events and tickets in order to get all settings in order.
- I Think these database values where attached to a single ticket before:
_tribe_ticket_global_stock_level
_tribe_ticket_use_global_stock
_tribe_ticket_capacityHowever now it seems that these are associated with the event instead of single tickets?
Which leads to my problem that these meta_keys are not in place in the database and i cannot give values to them through mysql update. Is there any solution how could i add these metakeys and values to events.
If i add in the backend the shared capacity to single ticket these keys and values appear in the database. As this is very time consuming i would like to know how to add these meta_keys and their values to database.
Thanks
January 5, 2018 at 3:55 pm #1419276VictorKeymasterHi Ilkka!
Thanks for reaching out! Let me try to help you with this topic.
The _tribe_ticket_capacity meta_key was introduced in Event Tickets 4.6 and from what I am aware, it can be associated with both tickets and events.
The _tribe_ticket_global_stock_level meta_key is associated with the event and sets the global stock for that event that can be shared between multiple tickets.
And the _tribe_ticket_use_global_stock is also associated with the event and is a boolean value.
Do note that those meta_keys will only be present for the events that have tickets assigned, and are generated as a consequence of tickets creation.
Does this help achieve what you are looking for?
Please also note that it’s not recommended to modify any field via a mysql query, unless of course, you know exactly the implications of doing so.
Let me know if you have any follow up questions.
Best,
VictorJanuary 5, 2018 at 11:08 pm #1419414IlkkaParticipantHi,
This gives a more depth understanding of what is going on. But what i try to achieve is that i could be setting global ticket sales on for massive amount of events.
For example i have 100 event and all events have four different tickets with global stock. In a normal way. Clicking to the events and making these would acquire loads of time, pushing buttons and loading pages. I am looking for a solution that i can make these settings directly to the database in order to keep the working process smooth.
So my problem is that these attributes come available in database only after the global settings has been made in the backend for the event and the ticket. The event does not have these attributes before:
_tribe_ticket_global_stock_level
_tribe_ticket_use_global_stockSo i can not add values to these by database update. For example:
In database there is always an option for show map link (for event):
_EventShowMapLinkANd It is empty by default. If i put 1 to the database. The frontend event page will start showing the maplink.
However this is not the case with these two settings.
_tribe_ticket_global_stock_level
_tribe_ticket_use_global_stockThey do not exist in the table before the settings have been turned on in the backend. And this makes it very hard (for me) to understand how these values could be added in the database, as these values have meta_id which is constantly changing. I could use insert into command in sql but i do not know how these meta_id’s are being created.
Check the image.
Thanks.
January 5, 2018 at 11:16 pm #1419417IlkkaParticipantHi,
Just one more thing. Ideally these setting would be on the table and therefore it would be very easy to give whatever meta_values to these meta_keys.
I hope your r following what i try to achieve. So i am just looking for a convenient way to add this setting so i d not have to go through 1000 events and their tickets. As this will take a week. Before i was able to do this in easy way to the database, not anymore.
Thanks.
January 8, 2018 at 4:58 am #1420310VictorKeymasterHi Ilkka!
I can totally understand what you are trying to accomplish there. Thanks for the detailed explanation.
This is a bit out my knowledge and I want to make sure to not misguide you here, so I will reach out to the team to have a second opinion and will get back to you as soon as I have something.
Please hang in there.
Thanks,
VictorJanuary 8, 2018 at 11:51 am #1420657VictorKeymasterHi Ilkka!
Thanks for your patience.
We think the easiest approach would be to write a small PHP script to do this (that could be implemented as a plugin).
The basic idea would be to use tribe_get_events() for all events (https://theeventscalendar.com/knowledgebase/using-tribe_get_events/), then iterate through them and setup those missing meta fields where needed (basically inserting the missing metadata records)
We don’t think there will be any implications for events that don’t already have tickets, but we really think you should test from a staging site first to make sure nothing breaks.
I hope that helps you get started. Let me know if you have any follow up questions.
Best,
VictorJanuary 12, 2018 at 4:37 am #1424518IlkkaParticipantHi,
Thanks for your answer. I could achieve this by using Custom field bulk editor. So i can add these lines to database with no problems. Thank you for your answers.
ilkka
January 12, 2018 at 6:18 am #1424590VictorKeymasterHey Ilkka!
Glad to know you could work that out! Thanks for letting us know and for sharing they way you achieved that, so other users can benefit from it.
I’ll close this thread now, but feel free to open a new topic if anything comes up and we’ll be happy to help.
Cheers,
Victor -
AuthorPosts
- The topic ‘Shared capacity for tickets in database’ is closed to new replies.