Hi,

I use Address Field 7.x-1.2 on a Drupal 7.43 web site.

I need to print the address components (thoroughfare, postal code, city, country) with PHP in a Display Suite code field.

I can't manage to print to country full name. The following code prints the country code :

$adresse = $payeur->field_user_adresse2['und'][0]['thoroughfare']."
";
$adresse .= $payeur->field_user_adresse2['und'][0]['postal_code'] . " " . $payeur->field_user_adresse2['und'][0]['locality']."
";
$adresse .= $payeur->field_user_adresse2['und'][0]['country'];

Is there a way to achieve this ?

Thx in advance for your support.

Comments

misterpo created an issue. See original summary.

ashish.verma85’s picture

hi, you can do something like this:
$countries = _addressfield_country_options_list();
print $countries[$countrycode];

Please check and let me know.

bojanz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Richard15’s picture

+1 for ashish.verma85!

steveoriol’s picture

+1 for ashish.verma85 :-)