A Cozmoslabs Product
Documentation / Developer Knowledge Base / Redirect user to custom page after Manual Payment

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' || !isset( $_POST['subscription_plans'] ) )
        return $url;
 
    $subscription_plan = pms_get_subscription_plan((int)$_POST['subscription_plans']);
 
    if( !isset( $subscription_plan->id ) || $subscription_plan->price == 0 )
        return $url;
    else
        return home_url('/payment-info');
}

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

In case you are using the Profile Builder form in order to register the user, you will also need to add these 2 lines of code to your website:

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