Created
October 14, 2013 23:55
-
-
Save xurizaemon/6984345 to your computer and use it in GitHub Desktop.
CiviCRM - implementation of hook_civicrm_buildForm() to remove required billing address fields.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_civicrm_buildForm(). | |
*/ | |
function example_civicrm_buildForm($formName, &$form) { | |
switch ($formName) { | |
case 'CRM_Contribute_Form_Contribution_Main': | |
$fields_not_required = array( | |
'billing_first_name', | |
'billing_middle_name', | |
'billing_last_name', | |
'billing_street_address-5', | |
'billing_city-5', | |
'billing_state_province_id-5', | |
'billing_postal_code-5', | |
'billing_country_id-5', | |
); | |
foreach ($fields_not_required as $field) { | |
$form->_paymentFields[$field]['is_required'] = FALSE; | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment