Support

Home Forums Event Espresso Premium venue address display (inline)

venue address display (inline)

Posted: March 6, 2015 at 9:03 am

Viewing 3 reply threads


adasch

March 6, 2015 at 9:03 am

Hi there,
German addresses are displayed differently from addresses in the US. Normally it looks like this:

Street Name, Number, ZIP code, City

My venues are displayed as follows:
Street Name, Number, CityCountry-Code, ZIP Code

I want to get rid of the CountryCode (there is no blank between city and the code by the way) and I want to pull the ZIP code in front of the City.

I found a file called EEH_Formatter.helper.php
It seems that I could make some changes here but this file is not update safe.

Is there another way to do that?

thanks


Lorenzo Orlando Caum

  • Support Staff

March 6, 2015 at 10:02 am

Hello again, could you take a look at this example?

https://eventespresso.com/topic/address-still-now-showing-correctly/#post-143031

Let us know if that helps.


Lorenzo


adasch

March 9, 2015 at 4:04 am

Great, this does exactly what I was looking for. Thanks!

You can display the address as “german standard” like this:

function espresso_venue_address( $type = 'multiline', $VNU_ID = 0, $echo = TRUE ) {
    EE_Registry::instance()->load_helper( 'Venue_View' );
    $venue = EEH_Venue_View::get_venue( $VNU_ID );
    if ( $echo ) {
        echo '<div>' . $venue->address() . ', ' . $venue->zip() . ' ' . $venue->city() . '</div>';
        return '';
    }
    return EEH_Venue_View::venue_address( $type, $VNU_ID );
}


Lorenzo Orlando Caum

  • Support Staff

September 12, 2015 at 11:29 am

Hi there Andreas,

We wanted to let you know about an enhancement in the current version of Event Espresso 4 that offers more flexibility for venue addresses.

First, please backup your WordPress site and upgrade to the latest release of Event Espresso 4:

https://eventespresso.com/wiki/ee4-changelog/

Next, there is some sample code in this link:

https://gist.github.com/lorenzocaum/5e2658a1f7e7a9a6b5c0

Here is an explanation of the sample code:

In the older versions of Event Espresso, you could change the formatting for the venue address. However, this would apply to all venue addresses. The new enhancement is more flexible as it allows you to change the formatting for certain countries.

In the example code, we have an entry for United Kingdom which has a country code of GB. Then we have the actual formatting which doesn’t include the province or the country name.

Just below that, we have an entry for Canada which has a country code of CA. In Canada, the zip/postal code appears as the end of the address so the formatting will show it in that order.

Below that is an entry for Germany which has a country code of DE with the formatting that you shared.

If you have modified the venue address through an existing function, then you may consider switching to the new one mentioned in the link above.

Thanks!


Lorenzo

Viewing 3 reply threads

The support post ‘venue address display (inline)’ 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