Support » Plugin: Woocommerce User Email Verification » How to get error notification on the front page

  • Resolved eppu

    (@eppu)



    Hi,

    I have move the registration to front page and I’m having difficulties displaying error notifications.

    In setting I have set that the user cannot login if he/she has not verified hes/hers email address.

    So I was wondering is its possible to display error notification messages in the front page. So the user knows that he/she has to verify hes/hers email address.

    Thank you for your help

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author XLPlugins

    (@xlplugins)

    Hello

    This option has been added in the new version of the plugin (http://prntscr.com/i3wx9t).
    You can select the error message page from the settings screen.
    The user will be redirected to the selected page after registration.
    If the user has not verified itself, then also user will be redirected to the selected page.

    Please update your plugin.

    Thanks

    eppu

    (@eppu)

    Or actually I have my registration in my navigation in a mega menu. So it would be nice to have the error notification displayed on any page that user is currently on.

    In my mega menu I have:
    <?php wc_print_notices(); ?>
    so incorrect password message is displayed in the mega menu and also the message is copied to the page head to help the user to notice the error notification.

    So how can I display error notices produced by “Woocommerce User Email Verification” on a custom page.

    Plugin Author XLPlugins

    (@xlplugins)

    Right now this feature is not available in the plugin.
    We may consider this in the future development of the plugin.

    eppu

    (@eppu)

    Sorry for describing my problem incorrectly in the first post. I tried to change it but unfortunately I could not edit the first post.

    Jason Davis

    (@jasondavis916)

    My plugin is updated to the new version, I’m testing signing in with an unverified account. It’s redirecting to the proper page with its template but no messages are appearing. I’m using | echo do_shortcode(‘[wcemailverificationmessage]’); | both in and outside the post loop, not working in either.

    So how do I get the messages to show?

    Plugin Author XLPlugins

    (@xlplugins)

    Hello Jason

    Can you please raise a ticket from here -> https://prnt.sc/i49m3w

    Thanks

    eppu

    (@eppu)

    Hi @jasondavis916,

    My guess would be that you are missing the
    <?php wc_print_notices(); ?>
    function that actually prints out the notification.

    And the [wcemailverificationmessage] only prints verification success notification, not the error notifications.

    @xlplugins you should do your support publicly, so people can support each other.

    Thanks

    eppu

    (@eppu)

    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.

    Jason Davis

    (@jasondavis916)

    Thx @eppu,

    That solved my problem.

    eppu

    (@eppu)

    Hi @xlplugins,

    can you confirm if you you are adding the filter in you next update ? =)

    Thank you for your help and for great plugin
    -Eppu

    Plugin Author XLPlugins

    (@xlplugins)

    Hello @eppu
    The filter has been added to the latest version of the plugin.

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to get error notification on the front page’ is closed to new replies.