A Cozmoslabs Product
Documentation / Developer Knowledge Base / Change the Payment Error Message that displays on the registration form

Change the Payment Error Message that displays on the registration form

The standard message we display when a payment fails during the registration process can be changed with the following code:

1
2
3
4
5
6
7
8
add_filter('pms_payment_error_message', 'pmsc_change_payment_error_message', 20, 2);
function pmsc_change_payment_error_message($error, $is_register) {
	if ($is_register == '1') {
		$error = __('Something went wrong while trying to process the payment. Your account has been created, so please <a href="/login">log in</a> and retry the payment.', 'paid-member-subscriptions');
	} 
 
	return $error;
}

Customize the message from the $error variable.

In this example, I am adding a link to the /login page over the log in words.

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