Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created August 26, 2022 11:52
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/f0e23788de4586da5a217229b1a83839 to your computer and use it in GitHub Desktop.
Save Pebblo/f0e23788de4586da5a217229b1a83839 to your computer and use it in GitHub Desktop.
Example of how to hook into the finalize registration step and log details to the error log.
<?php //Please do not include the opening PHP tag if you alreayd have one.
//Debug function to easily write various vars to the log.
if ( ! function_exists('tw_ee_write_log')) {
function tw_ee_write_log( $log ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
add_action(
'AHEE__EE_SPCO_Reg_Step_Finalize_Registration__process_reg_step__completed',
'tw_ee_log_process_reg_step__completed',
10,
2
);
function tw_ee_log_process_reg_step__completed($checkout, $txn_update_params) {
if (! $checkout->transaction_has_primary_registrant()) {
tw_ee_write_log(
array(
'Checkout' => $checkout,
'txn_update_params' => $txn_update_params
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment