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) »
  • Require Billing Name and Address fields with $0 transaction
Pages: [1]

Author Topic: Require Billing Name and Address fields with $0 transaction  (Read 684 times)

coryms

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
Require Billing Name and Address fields with $0 transaction
June 30, 2010, 11:20:38 am
In CiviContribute, I'm using contribution pages that have a $0 option in the gift array.

If they check the $0 and do not give a donation, their name and address is not required and I'm not able to collect it (and send them a free newsletter).

This comes from CRM/Contribute/Form/Contribution Main.php
-------------
        if ( (float ) $amount <= 0.0 ) {
            return $errors;
        }
-------------

If I remove that, it requires the info but also the credit card information.

How do I get it to ONLY require name and address information in the event that the donation amount = 0.00?




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: Require Billing Name and Address fields with $0 transaction
June 30, 2010, 12:16:54 pm

i would use the hook_civicrm_validate and add a rule to make those fields required. That would ensure they are always filled in

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

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Require Billing Name and Address fields with $0 transaction
July 01, 2010, 12:47:07 pm
Are you using a profile on your contribution page?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Require Billing Name and Address fields with $0 transaction

This forum was archived on 2017-11-26.