So…I just found out that the shortcodes for the login and registration pages are now removed from Woocommerce….
I know the forms are inside “My account” page, but I need a link in the menu to invite users to register or login, without having to explore the whole site first.
Is there a way to modify my theme’s functions to achieve this (so I don’t use another plugin)?
1 1
Using the [woocommerce_my_account] shortcode, a user will see their account details if they’re logged in and if they’re not logged in, they’ll see a login and registration form.
Using the same page title “My Account” for these different users isn’t ideal because a user that has never created an account won’t naturally navigate to a “My Account” page in order to create an account.
A possible solution is to add the page that includes that shortcode twice to your navigation menu, name them “Login” and “My Account”, and give them separate classes:
Then we can control the visibility of the navigation links based on if a user is logged in: