Redirect user to custom page after Manual Payment

You might want to redirect the user to a special page where they can see payment information, in case they want to pay through the Manual / Offline payment gateway.

This can be achieved using a code snippet:

1
2
3
4
5
6
7
8
9
10
11
12
add_action('pms_get_redirect_url', 'pmsc_redirect_after_manual_payment', 10, 2);
function pmsc_redirect_after_manual_payment( $url, $location ) {
	if ( isset($_POST['pay_gate']) && $_POST['pay_gate'] != 'manual')
		return $url;
 
	$subscription_plan = pms_get_subscription_plan($_POST['subscription_plans']);
 
	if ($subscription_plan->price == 0)
		return $url;
	else 
		return home_url( '/payment-info' );
}

Replace `/payment-info` with the slug of your own page.