• Resolved boqorwp

    (@boqorwp)


    Could anyone please help me out with a small code snippet I’m trying to put in place?

    When someone logs in / registers on woocommerce by filling out the login/registration form id like to add the email parameter to the url they’re being redirected to? I’m new to WordPress and have hit a lot of brick walls when attempting to write a code snippet for this. Any help or suggestion would be very very much appreciated.

    Use case:

    1: someone logs in / registers (and therefore provides their email address in the email address field as part of the login/registration flow)

    2: they are redirected to a url

    3: the email address is appending dynamically to whatever url they were redirected to

    // example walk through:

    1: someone logs/registers with their email address of [email protected] on woocommerces form handler

    2: they are redirected to https://www.goodexample.com/my-account

    3: our code snippet ensures the url they are redirected to always has “[email protected]” appended to it at the end. In this case the email they provided was [email protected] and the url they were going to be redirected to without the code snippet was https://www.goodexample.com/my-account. With our custom code snippet they URL they are redirected to in the end is actually https://www.goodexample.com/[email protected] (code snippet needs to work for any email that is used to login / register and for all urls they might be redirected to

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support katerinaz – a11n

    (@katerinaz)

    Hi there @boqorwp
    Hmmm… ?In order to append the user’s email to the URL after login or registration, you could use the?woocommerce_login_redirect?filter. This filter should allow you to modify the URL a user is redirected to after logging in.
    Please note that your request is related to a customisation so please keep in mind that you might not get substantial info through this forum as it is mainly for out-of-the-box related issues.
    You might need to eventually reach out to the WooCommerce Slack developing community for free tips on your custom code request: https://woocommerce.com/community-slack/

Viewing 1 replies (of 1 total)
  • The topic ‘Login/registration redirect’ is closed to new replies.