Gavin Mair

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • Gavin Mair
    Participant

    Hi Jaed,

    Super. Thank you all.

    Toby

    Gavin Mair
    Participant

    Hi Jaed,

    Thank you for letting me know :). I tried both shortcodes and have two questions.

    1. Unfortunately, the [alg_wc_ev_new_user_info] shortcode does not show any information (i.e. no visual output). I placed it on the ‘/welcome’ page to which users are redirected after registration. Please can you describe the output I should expect to see and think why I might not be able to see it?
    2. The resend form worked, but how can I add success and failure messages after ‘Submit’ is pressed? Secondly, where can I find the PHP template for this you mentioned? It would be nice to change the button text for the ‘Submit’ button.

    Thank you for working on these features. I look forward to hearing from you soon.

    Toby

    Gavin Mair
    Participant

    Hi,

    Is it possible to create a link that sends someone a verification link in the same way as the ‘resend’ option when looking at the ‘Users’ table on the WordPress backend?

    Existing users get a verification email if we send it from the backend.

    Gavin Mair
    Participant

    Hi Zohaib,

    Those are exactly the settings I was using. However, the resend link is not sending a verification to any of those existing users when they click it.

    in reply to: How can I redirect the user to a custom URL? #101537
    Gavin Mair
    Participant

    Hi Pablo,

    Ah, you have a filter for exactly that! Super. Thank you for sending that to me. I had to get something working today but I’ll give that snippet a go.

    Does you team plan to write a complete reference to the plugin’s actions and filters etc.? I’d love to see that.

    Great job on this plugin. I got it this week and it was very easy to configure. 🙂

    Thank you for yours and Zohaib’s help.

    Enjoy your weekend!

    in reply to: How can I redirect the user to a custom URL? #101535
    Gavin Mair
    Participant

    Hi Pablo,

    Oh, it’s the user ID. In that case I’ll just check for the presence of the query parameter (by name) but not take into account its value. That way it will always work.

    Please let me know if you spot any flaws in my approach if you test the code.

    in reply to: How can I redirect the user to a custom URL? #101533
    Gavin Mair
    Participant

    It seems that the number in &alg_wc_ev_activate_account_message= changed from 323 to 327. I’m not sure why. What’s the correct number for the following message?

    ‘Thank you for your registration. Your account has to be activated before you can log in. Please check your email.’

    in reply to: How can I redirect the user to a custom URL? #101532
    Gavin Mair
    Participant

    Hi Zohaib,

    I unblocked the WooCommerce order received (‘thank you’) page and was able to redirect to a custom URL by using the  &alg_wc_ev_activate_account_message=323 query parameter that is added when email verification is pending after checkout.

    Hopefully this is a good way to go about this.

    Here is the PHP snippet for other users.

    /*
        About: Email Verification (WPFactory) | Redirect to a custom page from the order received page after WooCommerce checkout.
        Author: Toby
        Date: 03/03/2022
    */
    
    function td_redirect_when_awaiting_email_verification_on_order_received_page() {	
    // Inspect URL query parameters to detect if verification is pending. 
        global $wp;
        $page_url_with_query_params = add_query_arg( $_SERVER['QUERY_STRING'], '', home_url( $wp->request ) );
        $awaiting_verification = str_contains($page_url_with_query_params, "&alg_wc_ev_activate_account_message=323");
    	
        if (is_order_received_page() && $awaiting_verification) {
    	// Do redirect.
            redirect_to_page("welcome");
        }	
    }
    
    // Redirect to a page given its slug.
    function redirect_to_page($pageSlug) {
        $URL = get_site_url() . "/$pageSlug";
        wp_redirect($URL); 
        exit; // wp_redirect() does not exit / die automatically.
    }
    
    // Register the action.
    add_action('template_redirect', 'td_redirect_when_awaiting_email_verification_on_order_received_page');
    
    in reply to: How can I redirect the user to a custom URL? #101531
    Gavin Mair
    Participant

    Hi Zohaib,

    Thank you for getting back to me.

    I’ve disabled a ‘thank you’ page customisation that was interfering with this as it’s not longer needed. I have the following settings on the ‘Email Verification > ‘Advanced’ section.

    • The redirect for ‘Prevent login after register’ is successfully going to a custom redirect URL of ‘/welcome’.
    • After blocking the ‘thank you’ page, users are now redirected to the WooCommerce ‘/my-account’ dashboard (where the login form appears) once they have completed checkout. I now need to change this so they are instead sent to ‘/welcome’.
    in reply to: How can I redirect the user to a custom URL? #101529
    Gavin Mair
    Participant

    Hi,

    An update: I am using the following PHP snippet to redirect users back to a custom login form if they log out (instead of the default WooCommerce one at ‘/my-account’). I need a way to change the redirect to a custom URL after the user has completed the WooCommerce checkout. I want to send them to a ‘/welcome’ page where I have a custom message asking them to check their email for a verification link.

    add_action('wp_logout', 'redirect_after_logout');
    function redirect_after_logout() {
        $loginURL = get_site_url() . "/login";
        wp_redirect($loginURL);
        exit();
    }
    
Viewing 10 posts - 1 through 10 (of 10 total)