Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With Give activated, Purchasing and creating an account with WooCommerce forces the customer login after purchase #2539

Closed
mathetos opened this issue Dec 19, 2017 · 8 comments
Assignees
Milestone

Comments

@mathetos
Copy link
Member

Issue Overview

With Give activated, Purchasing and creating an account with WooCommerce forces the customer login after purchase

Expected Behavior

WooCommerce customer flow should not be impacted by Give in any way.

Current Behavior

If you have Give activated and WooCommerce, then when purchasing and creating an account, the customer is automatically logged in after purchase. This is not the default behavior of WooCommerce, customers.

Steps to Reproduce (for bugs)

  1. Enable WooCommerce (version 3.5.6) with Dummy Data provided in the plugin
  2. Do a checkout and notice that the customer is NOT logged in.
  3. Activate Give (1.8.17) and do another checkout. Note that you ARE logged in automatically.

Note that I also attempted to disable the Give autologin function via the filter provided:

add_filter('give_log_user_in_on_register', 'give_dont_auto_login');

function give_dont_auto_login() {
	return false;
}

This filter works as expected for Give forms, but has no impact on the WooCommerce autologin described above.

@kevinwhoffman
Copy link
Contributor

Recommended Debugging Steps

  1. With Xdebug activated, insert a breakpoint at this line.
  2. Complete the Steps to Reproduce above.
  3. When the breakpoint triggers, review the stack trace to see what caused the login.

@mehul0810
Copy link
Contributor

@DevinWalker @mathetos @kevinwhoffman I've investigated more into the issue and created a video.
https://drive.google.com/open?id=1Quxk4lDq-kmNzvYmvxit8amRSXGx4w_y

Let me know your thoughts.

@raftaar1191
Copy link
Contributor

raftaar1191 commented Dec 19, 2017

Nice Video and Finding @mehul0810

Totaly agreed with you
One thing we should hide the admin bar tools too in Give Core When the user has Give Donor Role

@DevinWalker
Copy link
Member

I'm not so sure we should hide the admin bar. Why does Woo hide it anyways?

@mathetos
Copy link
Member Author

mathetos commented Dec 19, 2017

@DevinWalker It's not about hiding the Admin bar, it's that Woo customers are NOT auto-logged-in after purchase. But when Give is active they ARE logged in. That shouldn't happen.

EDIT: I missed @mehul0810 's video above. I understand now what he's saying. We shouldn't touch the admin bar visibility in any way IMHO.

@Benunc
Copy link
Member

Benunc commented Dec 19, 2017

I don't know, in my tests, I was still logged in after purchase without Give active, I just was not able to see the black bar, and wp-admin redirected to my-account on the front end.

@mathetos
Copy link
Member Author

I tested again, and inspected the dom after purchase with Give NOT activated. I believe that WooCommerce is NOT logging their customers in, but similarly to our "Guest Donations" feature, they are showing that information based on sessions, not an actual login. So the issue still remains that Woo does NOT log their customers in, but when Give is active they DO get logged in.

I think it's worth inspecting the Give functions that do the auto-login to ensure we're not stepping on the toes of other popular plugins.

@DevinWalker
Copy link
Member

Resolved:

See the code issue via my video here: https://goo.gl/BTf7pv

I realized I didn't explain why we need these two filters in our plugin so I made another video explaining that here: https://goo.gl/6CBLRi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants