Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created August 14, 2018 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/474e8a8acd1dc4e5079a022041fb208b to your computer and use it in GitHub Desktop.
Save joshfeck/474e8a8acd1dc4e5079a022041fb208b to your computer and use it in GitHub Desktop.
Payeezy gateway for EE4: removed required flag for all address fields on the billing form.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_payeezy_remove_required( $options, $form ) {
if( $form instanceof EE_Billing_Attendee_Info_Form
&& isset( $options[ 'name' ] )
&& $options[ 'name' ] === 'Payeezy_Onsite_Billing_Form'
) {
$fields_to_remove_required = array(
'address',
'city',
'state',
'country',
'zip'
);
foreach( $fields_to_remove_required as $field ) {
$options[ 'subsections' ][ $field ]->set_required(false);
}
}
return $options;
}
add_filter(
'FHEE__EE_Form_Section_Proper___construct__options_array',
'ee_payeezy_remove_required',
10,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment