A Cozmoslabs Product
Documentation / Developer Knowledge Base / Redirect user to specific page if Manual/Offline gateway is selected

Redirect user to specific page if Manual/Offline gateway is selected

This will redirect the user to a page with payment information in case he selects the Manual/Offline payment gateway.

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

The page slug can be modified on this line: return home_url('/payment-info');

In case you are using the Profile Builder form and you want to do this redirect, you will need to add these 2 lines of code as well:

1
2
add_filter( 'wppb_after_success_email_confirmation_redirect', 'pmsc_redirect_after_manual_payment' );
add_filter( 'wppb_register_redirect', 'pmsc_redirect_after_manual_payment' );

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket