Support

Home Forums Event Espresso Premium Changing address format EE4

Changing address format EE4

Posted: March 21, 2016 at 4:56 pm

Viewing 2 reply threads


Ray

March 21, 2016 at 4:56 pm

Hi

I tried to change the address format for the event detail page according to:
https://gist.github.com/lorenzocaum/5e2658a1f7e7a9a6b5c0
and https://eventespresso.com/topic/formatting-venue-address-ee4/

But for some reason I cant get it working. Please see following event:
https://mindgroup-professionals.ch/kurse/mgp-informationsabend/

I added the following code to the child’s functions file:

function ee_adjust_formatting_venue_address( $address_formats ) {
    $address_formats[ 'DE' ] = "{address}%{address2}%{zip}%{city} {country}";
    return $address_formats;
}
add_filter( 'FHEE__EE_MultiLine_Address_Formatter__address_formats', 'ee_adjust_formatting_venue_address', 10, 1 );
add_filter( 'FHEE__EE_Inline_Address_Formatter__address_formats', 'ee_adjust_formatting_venue_address', 10, 1 );

Please advice

Many thanks
Ray


Tony

  • Support Staff

March 22, 2016 at 5:14 am

Hi Ray,

The address formatting is applied based on the country set for that specific address, that’s a Schweiz address correct?

If you want that address to be formatted the same as German addresses you will need to add something like this:

$address_formats[ 'CH' ] = "{address}%{address2}%{zip}%{city} {country}";

To your function above. Try this:

function ee_adjust_formatting_venue_address( $address_formats ) {
    $address_formats[ 'DE' ] = "{address}%{address2}%{zip}%{city} {country}";
    $address_formats[ 'CH' ] = "{address}%{address2}%{zip}%{city} {country}";
    return $address_formats;
}
add_filter( 'FHEE__EE_MultiLine_Address_Formatter__address_formats', 'ee_adjust_formatting_venue_address', 10, 1 );
add_filter( 'FHEE__EE_Inline_Address_Formatter__address_formats', 'ee_adjust_formatting_venue_address', 10, 1 );


Ray

March 22, 2016 at 12:06 pm

Great. Many thanks, that worked.

Keep up the great work.
Ray

Viewing 2 reply threads

The support post ‘Changing address format EE4’ 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