Hi,
I got mine to work and I was wondering if you could add one filter for your next update so my fix keeps working after your next update.
Here is how i got it working:
I because my site uses custom login/register I modified function “custom_form_login_check” in your file “class-xlwuev-woocommerce-confirmation-email-public.php” on line 327. I added a filter so I could modify the slug in my child theme.
Here is the modified functions that included the filter “xlwuev_custom_form_login_check_redirect_url” and this is the filter that I would like you to add:
/*
* This function executes just after the user logged in. If restrict user setting is enabled in the plugin settings screen, the the user is force
* logged out.
*/
public function custom_form_login_check( $user_login ) {
$user = get_user_by( 'login', $user_login );
if ( ! is_super_admin() && 'administrator' != $user->roles[0] ) {
if ( true != get_user_meta( $user->ID, 'wcemailverified', true ) ) {
$is_force_login_enabled = XlWUEV_Common::get_setting_value( 'wuev-general-settings', 'xlwuev_restrict_user' );
if ( '1' == $is_force_login_enabled ) {
wp_logout();
if ( false == is_order_received_page() && false == $this->is_checkout_page ) {
$redirect_url = add_query_arg( array( 'xlsm' => base64_encode( $user->ID ), ), apply_filters( 'xlwuev_custom_form_login_check_redirect_url', get_the_permalink( $this->my_account ) ) );
wp_redirect( $redirect_url );
exit;
}
} else {
// Do Nothing
}
}
}
}
So after adding the filter I modified the output in my child theme.
Here is the code from my child themes functions.php:
/**
* Create a custom filter for email verification redirect slug
* Needed for the error notice to work
* -Eppu
*/
add_filter('xlwuev_custom_form_login_check_redirect_url','xlwuev_custom_form_login_check_redirect_url_customization');
function xlwuev_custom_form_login_check_redirect_url_customization () {
$slug = get_post_field( 'post_name', get_post() );
return $slug;
}
And also as I mentioned before I’m loading the <?php wc_print_notices(); ?>
function in my navigation so error notifications are displayed in my navigation.
Thank you so much for a great plugin and support, keep up the good work and please if you can add the filter I mentioned in my text in your next update.