-
Author
-
June 20, 2018 at 23:25 #201382maxlevelParticipant
Can somebody help me to change this php code so not the normal WordPress login window appears but instead the KLEO pop-up with the WordPress Login/Registration?
An account is already registered with your email address. <a href=”/wp-login”> Please Login. </a> Forgot Password? <a href=”/my-account/lost-password”> Click here to get a new one. </a>
June 21, 2018 at 18:05 #201466RaduModeratorHi,
There are two ways to show the login pop-up
1. Adding at the end of the link /#show-login example : http://rdu.local/kleo/#show-login
2. Adding this class kleo-show-login to the element that you want to click and to appear the pop-up.
COPY CODE<a href="http://rdu.local/kleo" class="kleo-show-login">Login</a>
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJune 22, 2018 at 22:39 #201598maxlevelParticipantIs that true that method 1 is php and method 2 html?
I would need the php version.
June 22, 2018 at 22:44 #201599maxlevelParticipantI want to replace a line in a php file and want to show a link with the Ajax pop-up.
Would that be the right code?:
before: Please Login
after: Please LoginJune 22, 2018 at 22:51 #201600maxlevelParticipantOh sorry I didn’t put in the code as code:
here it is:
before:<a href=”/wp-login”> Please Login.
after:<a href=”/wp-login/#show-login”> Please Login.
By the way. Can I edit my posts? I didn’t find a way to do so.
June 25, 2018 at 16:52 #201875RaduModeratorHi,
The php version it’s something like this
COPY CODEecho ' <a href="/wp-login/"></a> ';
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 12, 2018 at 20:17 #209464maxlevelParticipantHi.
I need to reopen this post because I am still having troubles with this problem. I don’t understand code well enough to know how exactly to implement your suggestion.Basically, what I want to do is rewrite an error message during checkout. At the moment it says “An account is already registered with your email address. Please log in”.
I want to change the text a bit (which I know how to do) and my customers to be able to click on “Please log in” and I want the login widget to pop up. How exactly do that?
I’ve only managed to send them to another site where the widget pops up but I don’t want them to leave the checkout page.
This is the bit of Code I am working with in the Theme Functions php file:
COPY CODE/* ================= Woocommerce Email is already registered - Please Log in =================== */ function my_woocommerce_add_error( $error ) { return str_replace('An account is already registered with your email address. Please log in','Hi, you must be a returning customer. To keep your data safe login is required to purchase a membership. If you know your password <a href="/wp-login/???????"> Please Login</a> ',$error); } add_filter( 'woocommerce_add_error', 'my_woocommerce_add_error' );
What do I need to do here?
Thanks for your help!
Rudolf
September 13, 2018 at 13:49 #209501RaduModeratorHi,
COPY CODE<a class="kleo-show-login " href="#">Open Login</a>
Will generate this :
The pop-up will be shown if you are logged out !
So there you will add the above insteadCOPY CODE<a href="/wp-login/???????"> Please Login</a>
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 14, 2018 at 05:05 #209577maxlevelParticipantThanks for your reply! This works in html but not in php.
How do I get this to work in my Theme Functions php file?Thanks,
RudolfSeptember 14, 2018 at 18:10 #209617RaduModeratorHi,
I had tested the snippet from you and adding the link that i had suggested to you and it works
I had printed the output of the function and it works… make sure to be logged out for showing the login popup
COPY CODEfunction my_woocommerce_add_error( $error ) { return str_replace( 'An account is already registered with your email address. Please log in', 'Hi, you must be a returning customer. To keep your data safe login is required to purchase a membership. If you know your password <a class="kleo-show-login" href="#">Please Login</a> ' ,$error); } add_filter( 'woocommerce_add_error', 'my_woocommerce_add_error' );
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 20, 2018 at 16:01 #209987RaduModeratorHi,
In this case maybe that wooocommerce filter doesn’t not allow content with html class or any attribute, that’s the correct html structure that opens the pop-up.
So you will have to ask the woocommerce team how you can allow this type of content on their filter.
COPY CODE<a class="kleo-show-login" href="#">Please Login</a>
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.