Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created September 1, 2020 21:41
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/ac982be6bcac8b41c5ed7f6ff88a264c to your computer and use it in GitHub Desktop.
Save Pebblo/ac982be6bcac8b41c5ed7f6ff88a264c to your computer and use it in GitHub Desktop.
Example of how to fix the payment_url value for registration that have been imported using rhe importer add-on with partial payments.
<?php // Please do not include the opening PHP tag if you already have one
function tw_ee_payment_overview_url__query_args($query_args, $registration) {
// Pull the transaction from the registration object.
$transaction = $registration->transaction();
// Check we have an EE_Transaction object
// Check the 'attendee_information' step has NOT been complete
// Check we have at least 1 payment related to the transaction
// (likely an imported registration with attendee_information not set to true)
if ($transaction instanceof EE_Transaction
&& $transaction->reg_step_completed('attendee_information') !== true
&& $transaction->get_first_related('Payment')
) {
// Change the query args to go to the payment_options.
$query_args['step'] = 'payment_options';
$query_args['revisit'] = true;
$query_args['clear_session'] = true;
}
return $query_args;
}
add_filter( 'FHEE__EE_Registration__payment_overview_url__query_args','tw_ee_payment_overview_url__query_args', 20, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment