Support

Home Forums Event Espresso Premium Importing events – need to add venue and switch off registration form

Importing events – need to add venue and switch off registration form

Posted: November 16, 2014 at 12:59 pm

Viewing 6 reply threads


Ian Walters

November 16, 2014 at 12:59 pm

I have a CSV file with next years events to import – there are over 60 rows. Users can view events filtered by venue, so I need to link each event to a venue (in this file they are all the same venue). I also need to switch off the registration form as we are not using this yet. It will be extremely tedious to have to go into every event and manually add the venue and switch off the registration. Can you offer an alternative? We are running Event Espresso 3.1.36.1.P with Calendar add on (version 2.2.0.p) and Custom Template Display add on (version 1.0). WordPress version 3.9.2. Thanks, Ian


Sidney Harrell

November 17, 2014 at 2:19 pm

You would need to make modifications to plugins/event-espresso/includes/event-management/csv_import.php. You would need to do an insert into the EVENTS_VENUE_REL_TABLE to link the event to the venue. For the registration form, you’ll want to put another line into the $strings_sql_array on line 150:
'display_reg_form' => 'N',
For the insert into the venue relation table, take a look at the insert we do down on line 224. You’d need to take a look at the structure of the venue rel table, but you should just need to send it the event_id and the venue_id.


Ian Walters

November 18, 2014 at 8:51 am

Hi Sidney,
Thanks for the quick response and the info. Do i need to move this to the uploads/espresso so it doesn’t get overwritten upon next update?

Thanks


Ian Walters

November 18, 2014 at 8:58 am

Hi,

I’ve had a look at the code and is line 224 the correct line?

Cheers

Dave


Sidney Harrell

November 19, 2014 at 9:42 am

Unfortunately, there isn’t a function_exists wrapper on that function in core, so you’d need to make the modifications directly in that core file, and it will get overwritten on update, so you would need to re-modify it after each update. Fortunately, we won’t be releasing very many more updates to 3.1, as it is nearing end-of-life as we add more of the additional functionality that was in 3.1 into EE4. One thing you could do is add the function_exists wrapper to the core code, then put your override of that function into a custom functions plugin.
That insert down on line 224 you would need to use as a template of sorts, making another copy of that chunk of code and modifying it to make the insert into the venue relation table.


Ian Walters

December 1, 2014 at 8:07 pm

Hi,

Can you be more specific on how I add the venue into the import? Can I a just add the venue_id after categories or do I have to enter it as some sort of meta data? I have tried both and it doesn’t work.
Surely all events have a venue so I don’t really understand why its not documented a part of the plugin.
Thanks


Sidney Harrell

December 3, 2014 at 1:21 pm

You would need to add a new column on your csv that you want to import. You’ll want to settle on a format for putting multiple venue ids into that column, something like “12|42”. The cat import chunk of code was actually a better template: https://gist.github.com/sidharrell/1e7a3390f74d2cbb0065. Note that the venue ids will need to be in the system already for it to work. It will not create new venues.

Viewing 6 reply threads

The support post ‘Importing events – need to add venue and switch off registration form’ 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