Support

Home Forums Event Espresso Premium Custom VENUE_ADDRESS output?

Custom VENUE_ADDRESS output?

Posted: December 28, 2013 at 6:24 am


Klaus M

December 28, 2013 at 6:24 am

same here: saw some posts about this topic, but i don’t get it, sorry.

I want to show [VENUE_ADDRESS] in my event email like…
VENUE_LOCATION / VENUE_STREET / VENUE_ZIP VENUE_CITY

Thanks for helping me on this!


Dean

December 30, 2013 at 5:06 am

Hi,

The email tags for venues are:

[venue_title]
[venue_address]
[venue_url]
[venue_image]
[venue_phone]

The address is currently formatted to appear like so

A street
Somewhere
Sometown, California
94043
United States

There isn’t a simple way to change the structure without editing a core file.


Klaus M

December 30, 2013 at 1:26 pm

Hm, that is not very ideal. As this plugin is sold and used worldwide it would be really nice if admins could customize the ADDRESS to the order of STREET, ZIP, etc that is the rule in particular countries. I cannot use the ADDRESS tag with that output in my email ;( Very disappointing. There is really no way?


Sidney Harrell

December 30, 2013 at 10:13 pm

The output for that shortcode is built up by line 259 in includes/functions/email.php:

$data->location = ($data->event->address != '' ? $data->event->address : '') . ($data->event->address2 != '' ? '<br />' . $data->event->address2 : '') . ($data->event->city != '' ? '<br />' . $data->event->city : '') . ($data->event->state != '' ? ', ' . $data->event->state : '') . ($data->event->zip != '' ? '<br />' . $data->event->zip : '') . ($data->event->country != '' ? '<br />' . $data->event->country : '');

What Dean said is true, you would have to modify that core file since that function lacks the overwritable wrapper around it. That means your modification would be overwritten every time you update, forcing you to redo the modification each time you update.
Taking the long view of your situation, though, I think we could add 3 new hooks in. We should filter the $data before it comes out of that function, and the $SearchValues and $ReplaceValues in the function just above that, so that you could add custom functions outside of the core files to accomplish what you are trying to do.
If we add those hooks, they will be appearing in the 3.1.38 release. In the meantime, you can replace the above line with:

$data->location = 
($data->event->address != '' ? $data->event->address : '') .
($data->event->address2 != '' ? '<br />' . $data->event->address2 : '') .
($data->event->zip != '' ? '<br />' . $data->event->zip : '') . 
($data->event->city != '' ? '<br />' . $data->event->city : '') .
($data->event->state != '' ? ', ' . $data->event->state : '') .
($data->event->country != '' ? '<br />' . $data->event->country : '');


Klaus M

December 31, 2013 at 12:49 am

That sounds great, thanks for having this feature in your next update! I am sure a lot of customers will be very happy 🙂 When do you think this update will be released approximately? Maybe it makes sense to wait and not edit the core files now?

Thank you very much Sidney!


Sidney Harrell

December 31, 2013 at 5:10 pm

The next version is 3.1.37, but it’s to late in the release cycle to add new features into it. It’s in the bug-fix only stage. The filters have been added to the 3.1.38 version to give any new features time to be tested. So you should probably go ahead and make the changes now.


Klaus M

January 7, 2014 at 12:45 am

Thanks! I prefer waiting for the official update 🙂 Thanks for integrating this! I guess that helps a lot of users!

The support post ‘Custom VENUE_ADDRESS output?’ 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