This will redirect the user to a page with payment information in case he selects the Manual/Offline payment gateway.
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:
add_filter( 'wppb_after_success_email_confirmation_redirect', 'pmsc_redirect_after_manual_payment' );
add_filter( 'wppb_register_redirect', 'pmsc_redirect_after_manual_payment' );
Accept (recurring) payments, create subscription plans and restrict content on your website. Easily setup a WordPress membership site using Paid Member Subscriptions.
Get Paid Member SubscriptionsCombine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.
Get 25% off with the bundle