Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created May 4, 2021 10:32
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 Pebblo/1c2c55536bc88788194eae743e516633 to your computer and use it in GitHub Desktop.
Save Pebblo/1c2c55536bc88788194eae743e516633 to your computer and use it in GitHub Desktop.
<?php //Please do not include the opening PHP tag if you already have one.
add_filter('FHEE__EE_Form_Section_Proper___construct__options_array', 'tw_ee_sage_pay_form_filter', 10, 2);
function tw_ee_sage_pay_form_filter( $options_array, $form ) {
if( $form instanceof EE_Billing_Attendee_Info_Form
&& $form->payment_method() instanceof EE_Payment_Method
&& $form->payment_method()->type() === 'Sage_Pay_Server'
&& !empty( $options_array['subsections'] )
) {
$options_array['subsections'] = array(
'country' => $options_array['subsections']['country'],
'state' => $options_array['subsections']['state']
) + $options_array['subsections'];
}
return $options_array;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment