Created
August 14, 2018 19:59
-
-
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.
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
<?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