Okay
  Public Ticket #3162709
Registration redirection issue
Open

Comments

  •  2
    damteq12 started the conversation

    Hi we are having an issue where if the customer is registering as a trade (B2B) customer after they submit the request it just redirects them to the home page without giving any indication that it has been successful.

    It only happens when they register as a B2B customer as when they register normally the redirect to the thank you page works.

    This is the function below we use to redirect the signed up user.

    Is there a function we can implement or attach to our current function to redirect correctly if they are a trade customer?

    __ START CODE __

    add_filter('woocommerce_registration_redirect', 'filter_woocommerce_registration_redirect', 10, 1);

    function filter_woocommerce_registration_redirect($redirect) {
        return get_permalink(wc_get_page_id('registration-thank-you'));
    }
    __ END CODE __



  •  865
    WebWizards replied

    Hi there,


    1) "Hi we are having an issue where if the customer is registering as a trade (B2B) customer after they submit the request it just redirects them to the home page without giving any indication that it has been successful."

    Normally what should happen is that the user would stay on the "My Account" page and there would be a notification such as "Thank you for registering. Your account is pending approval...".

    However we do commonly see an issue where the user is redirected to the home page instead. It's almost always caused by the theme or some plugin which takes over the redirection, so we'd usually recommend deactivating all plugins / theme, to find where the issue is coming from


    2) I am not sure why that code would work for most users, but not for B2B users - perhaps because the B2B registration is on a different page.

    Can you please try to replace 

    add_filter('woocommerce_registration_redirect', 'filter_woocommerce_registration_redirect', 10, 1);
    

    with

    add_filter('woocommerce_registration_redirect', 'filter_woocommerce_registration_redirect', 10000, 1);

    and see if that helps solve it?


    That just increases the priority of the function, so perhaps it can help solve it.


    Kind regards,

    Stefan

  •   damteq12 replied privately
  •  865
    WebWizards replied

    Hi Marcus,

    B2BKing redirects by default to the My Account page, the page which is configured in WooCommerce -> Settings -> Advanced -> My account page. Please make sure the page is indeed selected there in settings.

    Another suggestion would be to try adding this code snippet:

    add_filter('b2bking_manual_approval_redirect_registration', function($url){
          $url = get_permalink( wc_get_page_id( 'myaccount' ) );
          return $url;
    }, 10, 1);
    

    If none of that helps, my belief is that there is another plugin, or something in the theme that is interfering.

    I can look into it directly if you would like. For that, I would need a backend login to your site, or a staging clone site.

    Kind regards,

    Stefan

  •   damteq12 replied privately
  •  865
    WebWizards replied

    Hi Marcus,

    I was trying to look into this now but that link doesn't seem to be working for me I'm afraid.

    7802726412.png


    I didn't open it before this. Can you check please?

  •   damteq12 replied privately
  •  865
    WebWizards replied

    I am sorry but I am seeing the same issue with that,

    You can drop it here as unencrypted - just make sure to mark the message as 'Private'.

    Only you and our team has access to this thread.

  •   damteq12 replied privately