Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
CiviCRM - implementation of hook_civicrm_buildForm() to remove required billing address fields.
* Implements hook_civicrm_buildForm().
function example_civicrm_buildForm($formName, &$form) {
switch ($formName) {
case 'CRM_Contribute_Form_Contribution_Main':
$fields_not_required = array(
foreach ($fields_not_required as $field) {
$form->_paymentFields[$field]['is_required'] = FALSE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment