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
March 22, 2016 at 5:14 am
Add New Note to this Reply
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
Add New Note to this Reply
Great. Many thanks, that worked.
Keep up the great work.
Ray