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 »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Postal Code as a required field in the billing address
Pages: [1]

Author Topic: Postal Code as a required field in the billing address  (Read 1336 times)

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Postal Code as a required field in the billing address
August 13, 2009, 12:54:30 pm
I'm encountering this problem in CiviContribute, although I'm not sure if this problem is specific to it.

CiviContribute is requiring that a postal code is given as part of the billing address.  In many countries, this makes no sense at all.

Is it possible to turn this off?  I'd prefer in my case to force the postal code to be present using custom logic, limiting it to just those countries where I actually need it.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Postal Code as a required field in the billing address
August 13, 2009, 01:14:14 pm

this has not come up in the past, so curious as to what countries you have in mind where it does not make any sense at atll :)

you can hack the code at: CRM/Core/Payment/Form.php, line 94 (approx)

you can potentially also do it via the buildForm hook. U'll have to check the quickform code to see how to "remove" a rule on an element

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Re: Postal Code as a required field in the billing address
August 13, 2009, 01:24:54 pm
Quite a lot of countries don't have them, or don't use them consistently.   Since the Democrats Abroad people operate in a lot of countries, this comes up a fair bit in their applications.

Here's what Wikipedia has to say about it:
Quote
In February 2005, 117 of the 190 member countries of the Universal Postal Union had postal code systems. Examples of countries that do not have national systems include Ireland and Panama. Another example is Hong Kong - although Hong Kong has become a special territory of China in 1997, Hong Kong maintains its own long-established postal system and does not use any postal code for domestic mails within Hong Kong. No Chinese postal codes are assigned to Hong Kong.

The buildForm hook sounds feasible for my purposes, and I'll give it a try.  Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Postal Code as a required field in the billing address

This forum was archived on 2017-11-26.