Endpoint after Buddypress registration on wordpress

deltavlokkies
Posts: 4
Joined: Sat Jan 30, 2021 7:49 pm

Re: Endpoint after Buddypress registration on wordpress

Post by deltavlokkies »

That fixed the issue.
The users now gets redirected to the right page after they place an order on the site.
Thank you so much! :D
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Endpoint after Buddypress registration on wordpress

Post by axew3 »

Ok, i do not know if your configuration provide or not the autologin for users when they place an order together with an account.
I have the install test with many other plugins together with woocommerce, and actually i see my user auto logged when he request a new account to be created with the order. DO not know at moment if it is due to woocommerce or any others profile plugins.

The code above about this, will be improved further more to check ever for correct hooks, and embedded into next plugin vers
User avatar
axew3
w3all User
w3all User
Posts: 2883
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Endpoint after Buddypress registration on wordpress

Post by axew3 »

the next plugin version, change the code of the
private static function create_phpBB_user(){
function, adding +- the follow right on bottom

note that if the code is not wrapped into

Code: Select all

 if ( class_exists('WooCommerce') ) {
or something else as explained, like

Code: Select all

// may restrict further more based on if some $_POST var exist or not 
  //if(isset($_POST['createaccount']) && $_POST['createaccount'] == 1 ){
then this will cause an autologin for users when they register, for any situation, even into default wordpress!

Code: Select all

  // FIX AUTOLOGIN for woocommerce or any other plugin, or even default wordpress: 
  // when user registered and need to be logged in automatically, then avoid to follow without phpBB session setup
  // or since the phpBB cookie is not released at this point, when verify_credentials will fire, the user will be logged out
  // add any other here, ex:
  // if ( class_exists('WooCommerce') OR isset($_POST['createaccount']) OR class_exists('somethingelse') ) {
 if ( class_exists('WooCommerce') ) {
 	// may restrict further more based on if some $_POST var exist or not 
  //if(isset($_POST['createaccount']) && $_POST['createaccount'] == 1 ){
     if( ! defined("W3ALL_SESSION_ARELEASED") && ! defined("PHPBBAUTHCOOKIEREL") ){ 
     $phpBB_user_session_set = self::phpBB_user_session_set_res($wpu);
     define("W3ALL_SESSION_ARELEASED", true);
    }
  //}
 }
  
  return;
deltavlokkies
Posts: 4
Joined: Sat Jan 30, 2021 7:49 pm

Re: Endpoint after Buddypress registration on wordpress

Post by deltavlokkies »

I updated the plugin today, and the bug is back.
When a users places an order it's not redirected to the right page.
Also, if they create a new account its get redirected home.
Is there a fix for this?


EDIT : The old fix doesn't seem to work anymore.

EDIT 2 : I'm running the latest wordpress and woocommerce versions.
Post Reply