fix for this:
l.63: Change
add_filter( ‘registration_errors’, array( $this, ‘show_user_pending_message’ ) );
To:
add_filter( ‘woocommerce_registration_errors’, array( $this, ‘show_user_pending_message’ ) );
HTH
-
This reply was modified 8 years, 5 months ago by
alian666.
Ok it doesn’t help so much if don’t use login theme, the function is now called, but you’re still logged.
So you can comment last filter (or don’t do the update I describe in my last post) and add this:
add_action(‘woocommerce_created_customer’, ‘logout_if_not_approved’,10,1);
function logout_if_not_approved($user_id) {
$user_status = get_user_meta( $user_id, ‘pw_user_status’ );
if ($user_status[0] == ‘pending’) {
wp_logout();
wp_redirect(get_permalink( get_option(‘woocommerce_myaccount_page_id’)) . ‘?msg=’. urlencode(“Account need validation”),302);
exit(0);
}
}
You must then catch $_GET[‘msg’] to display it after the redirect.
Hi there,
I have purchased your plugin.
It appears as though I am having the same problem as Darryl.
Can you please say which file the above code is supposed to go in? Can you please provide the file path?
Many thanks,
Eric
Hi there,
I have purchased your plugin.
It appears as though I am having the same problem as Darryl.
Can you please say which file the above code is supposed to go in? Can you please provide the file path?
Many thanks,
Eric