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

add auto-redirect if it is set for woocommerce pages too #630

Merged
merged 2 commits into from
Mar 26, 2019

Conversation

mostekcm
Copy link
Contributor

@mostekcm mostekcm commented Mar 2, 2019

Changes

Please describe both what is changing and why this is important. Include:

  • Endpoints added, deleted, deprecated, or changed
    Changed the overrides for the woocommerce login forms
  • Classes and methods added, deleted, deprecated, or changed
    Updated the WP_Auth0 main plugin to pass options to the woocommerce overrides class
    Updated the woocommerce overrides class to create a login button instead of login form if auto login is enabled.
  • Screenshots of new or changed UI, if applicable
  • A summary of usage if this is a new feature or change to a public API (this should also be added to relevant documentation once released)
    Should mention this in the new docs

Testing

Please describe how this can be tested by reviewers. Tests must be added for new functionality and existing tests should complete without errors.

I tested this by creating a woocommerce themed wordpress site.
I enabled Login by Auth0
Make sure that the "allow users to login on checkout" is enabled for the woocommerce accounts settings.

Try both navigating to /my-account and /checkout (note you have to create a product and add it to your cart to get to checkout).

If you are not logged in, you should now get a Login button, if you click the button, it redirects you to wp-login with the appropriate redirect_to set.

Checklist

@mostekcm
Copy link
Contributor Author

mostekcm commented Mar 2, 2019

Code is live at https://beautyfullday.com if you want to see how it works.

Copy link
Contributor

@joshcanhelp joshcanhelp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @mostekcm! A few changes required below. Also, tests would be nice if you can but not required.

lib/WP_Auth0_WooCommerceOverrides.php Outdated Show resolved Hide resolved
lib/WP_Auth0_WooCommerceOverrides.php Show resolved Hide resolved
lib/WP_Auth0_WooCommerceOverrides.php Outdated Show resolved Hide resolved
lib/WP_Auth0_WooCommerceOverrides.php Outdated Show resolved Hide resolved
lib/WP_Auth0_WooCommerceOverrides.php Outdated Show resolved Hide resolved
lib/WP_Auth0_WooCommerceOverrides.php Outdated Show resolved Hide resolved
@mostekcm
Copy link
Contributor Author

Sorry @joshcanhelp I would like to write some tests, but having to squeeze this in as it is. I did update https://beautyfullday.com with the updates and did some testing on that page and it is all still working :).

If you could build an example test for it, I could potentially fill in the details. I'm also not sure how to execute the tests...

@joshcanhelp joshcanhelp added this to the 3.10.0 milestone Mar 26, 2019
@joshcanhelp joshcanhelp merged commit caa7f1f into auth0:master Mar 26, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants