Support

Home Forums Event Espresso Premium simplified mysql to copy event

simplified mysql to copy event

Posted: July 28, 2020 at 11:41 am

Viewing 5 reply threads


wayne

July 28, 2020 at 11:41 am

Hi, what mysql table data is cloned when an event is duplicated. Im trying not to move away from ee4 but the recurring events is an issue and may have to duplicate over 700 events in the next few weeks. I was going to create a script to automate this as each day has effectively the same events and tickets each day Monday – Sunday. It is essentially booking football pitches by the hour. Is there a better work flow?

w


Tony

  • Support Staff

July 28, 2020 at 2:00 pm

Hi Wayne,

What you are trying to do isn’t as simple as it sounds (which is why we don’t have a simple workaround for rem right now).

Multiple tables are used for each and every EE event.

Some examples, (assuming the DB prefix is wp_) the post itself is stored within wp_posts.

The datetimes for that event will be in wp_esp_datetime

The tickets for the event in wp_esp_ticket

The relationship between the datetimes and tickets in wp_esp_datetime_tickets

Trying to manually do this with your own query is not simple by any means, you would be better taking a look at how the _duplicate_event function (the function called when you click the button) duplicates the event using our models (which then handle all of the queries/relationships for you.


wayne

July 28, 2020 at 2:17 pm

Hi Tony, thanks for your speedy response – im not sure the least painful approach. is it best to do each day so 300+ events with hourly tickets or what I have been trying which is to have one event per day, i.e Monday with multiple event date times with each having multiple available tickets on the hour. This seems easier from the admin but from what I can see does not look the simplest from a ux point of view
see. What would be your recommended workflow?
image1
image2


Tony

  • Support Staff

July 29, 2020 at 6:29 am

I can’t view those images currently although from what you’ve mentioned so far, I would likely use daily events as its easier for the main to “today’s” registrations that way.

So for example you’d go to Event Espresso -> Events

Load today’s registrations and export the report for a list of only today’s registrations, no selecting datetimes etc.


wayne

July 29, 2020 at 6:38 am

Thanks
Yes have opted for a daily event with hourly tickets- doing multiple event dates are all seen as one event and not separate. The pain is there are 4 events x 9 hourly slots of which sale times need updating per day for a year. My maths makes it 131k edits ((4*9)*365) over the year so will probably add hack a button in the admin to update date times using js once duplicated and create some kind of automated function.


Tony

  • Support Staff

July 29, 2020 at 6:50 am

Or, you could hook into the function I mentioned above (there’s a few hooks in that function to do the above) and do this via PHP when the button is clicked.

Doing this after the duplicate button is clicked with JS is doable but personally, rather than hacking something in JS I’d just use PHP to set the dates on the fly.

Viewing 5 reply threads

The support post ‘simplified mysql to copy event’ 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.

Event Espresso