CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • how to add postal code prefix in address format
Pages: [1]

Author Topic: how to add postal code prefix in address format  (Read 1077 times)

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
how to add postal code prefix in address format
December 30, 2014, 02:48:28 am

How can i add postal code prefix text in the address format in civicrm.

There is the checkbox for postal code suffix in civicrm, but there isn't anything like prefix for postal code

can anyone help this?

Thanks.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: how to add postal code prefix in address format
December 30, 2014, 03:15:47 am
There is not really a field for a postcode prefix, but what you can do is move the postcode suffix to the front of your address format? You can do this with Administer/Localisation/Address formats I think....
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
Re: how to add postal code prefix in address format
December 30, 2014, 03:39:07 am
no , that does not work(moving postal code suffix before postal code).

there is no token available for the postal code suffix in the dispaly or insert text area.

whenever i tried to insert token, it does not insert the token.

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
Re: how to add postal code prefix in address format
December 30, 2014, 04:16:02 am
yes i got this

i had to change CRM/Utils/Address.php file.

there is line  $fullPostalCode .= "$fields[postal_code_suffix]"  and   now this is changed to

$fullPostalCode = "$fields[postal_code_suffix]-" . $fullPostalCode.

Thanks for reply

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: how to add postal code prefix in address format
December 30, 2014, 05:31:14 am
Glad you fixed it. If you want to do this more often you might want to create an extension for it rather than changing the core code locally?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

dhirendra

  • I’m new here
  • *
  • Posts: 27
  • Karma: -1
  • CiviCRM version: 4.4.3
  • CMS version: drupal 7
  • MySQL version: 5
  • PHP version: 5.3.3
Re: how to add postal code prefix in address format
December 31, 2014, 02:17:25 am
how can i do this? i have no idea.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: how to add postal code prefix in address format
January 07, 2015, 12:03:26 am
You can check the documentation here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension

Is it clear why this would be a more structured approach?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • how to add postal code prefix in address format

This forum was archived on 2017-11-26.