Home › Forums › Trusted Pro › Register link is (in my case) pointing to wrong page.
- This topic has 13 replies, 2 voices, and was last updated 7 years, 1 month ago by Adri Oosterwijk.
-
AuthorPosts
-
November 16, 2017 at 9:50 am #2773Adri OosterwijkParticipant
Hi,
In my site i’m using Gravity Forms with the User Registration add-on. The expected behavior should be that when a visitor clicks on the Register Link he lands up on the custom registration page.
In the code (extras.php, line 946) I see this code:
?></p><?php woocommerce_account_navigation(); } else { ?><p class=”top-login-header”><span class=”top-login-login”><?php echo $woo_account_login_title;?></span></p><?php woocommerce_login_form($woo_login_args);?><p class=”top-login-footer”><span class=”top-login-register”>“><?php echo $woo_account_reg_title;?></span></p><?php } ?> ?></p>
As you can see the last part is (as far as I understand it) pointing to the value of $woo_account_page_url which is “My Account”.
Is that correct? How do I change it to my custom “User Registration” form?
In the User Registration Add-on of Gravity forms it is set correctly.
Any idea?
Your help is appreciated.
Adri
- This topic was modified 7 years, 1 month ago by Adri Oosterwijk.
November 16, 2017 at 10:04 am #2775Adri OosterwijkParticipantMade a wrong edit, sorry. here is the code piece again
<?php woocommerce_account_navigation(); } else { ?><p class=”top-login-header”><span class=”top-login-login”><?php echo $woo_account_login_title;?></span></p><?php woocommerce_login_form($woo_login_args);?><p class=”top-login-footer”><span class=”top-login-register”>“><?php echo $woo_account_reg_title;?></span></p><?php } ?>
- This reply was modified 7 years, 1 month ago by Adri Oosterwijk.
November 16, 2017 at 10:11 am #2777Adri OosterwijkParticipantSilly, but when I paste some code and submit my post a part of the pasted text is removed.
At least I can tell you it is on line 946 of the extras.php file. Sorry for the chaos.
November 16, 2017 at 11:07 am #2779AndyKeymasterYopu could copy the
trusted_tel_login_cart()
function (line 844 to line 1052 in extras.php) into your child theme functions.php file, and change the part where the ‘Register’ link is found.On line 946 change this part:
<a href="<?php echo $woo_account_page_url;?>"><?php echo $woo_account_reg_title;?></a>
to something like this:
<a href="http://www.mywebsite.com/my-registration-page/"></a>
PS to write code into a forum post, switch from Visual tab to Text tab and you can wrap the code with code tags using the ‘code’ button.
November 16, 2017 at 12:01 pm #2783Adri OosterwijkParticipantThanks for the quick response.
I tried that before but that didn’t work. That was the reason for contacting you.Still pointing to my-domain/my-account
The line looks like this now:
?></p><?php woocommerce_account_navigation(); } else { ?><p class="top-login-header"><span class="top-login-login"><?php echo $woo_account_login_title;?></span></p><?php woocommerce_login_form($woo_login_args);?><p class="top-login-footer"><span class="top-login-register"><a href="http://my-domain.dev/user-registration"> </a></span></p><?php } ?>
Any idea?
Adri
November 16, 2017 at 12:33 pm #2784AndyKeymasterSorry we’re missing the text for the link, so should be something like this:
<a href="http://my-domain.dev/user-registration"><?php echo $woo_account_reg_title;?></a>
or this:
<a href="http://my-domain.dev/user-registration">User Registration</a>
November 16, 2017 at 12:45 pm #2785Adri OosterwijkParticipantHi Andy,
Sadly, no avail. I’m wondering…. are we working on the correct code line. It looks like it is executed from somewhere else. Even a custom link text is not displayed. It still tells me “Register” while I changed it into “User registration”. Strange huh?
And it is still pointing to the my-account page.
November 16, 2017 at 12:46 pm #2786AndyKeymasterif you are also changing the text, you can use this to make ‘User Registration’ a translatable string:
<a href="http://my-domain.dev/user-registration"><?php esc_html_e( 'User Registration', 'trusted' );?></a>
November 16, 2017 at 12:50 pm #2787Adri OosterwijkParticipantYeah I know about the translation. The tricky part is, when I have translated the form, to create a link which is automatically picks the right user registration page in the right language. But one challenge at a time so to say. It would be great if we even get a link pointing to my custom registration page in the first place.
November 16, 2017 at 12:52 pm #2788AndyKeymasterAm I understanding correctly that it is the register link in the header that you want to change?
See image belowNovember 16, 2017 at 1:05 pm #2789Adri OosterwijkParticipantYeah, that’s the one.
I just flushed the caches, topped the server, restarted my machine but it is still behaving badly. Naughty link….November 16, 2017 at 1:14 pm #2790AndyKeymasterThere are two lines where it needs changing. Lines 946 and 978.
One is for when no telephone number present in the header and the other for when it is.
Sorry about that, my mistake.November 16, 2017 at 1:18 pm #2791AndyKeymasterYou can also make the link URL translatable to have it point to different location based on language like this
<a href="<?php _e( 'http://my-domain.dev/user-registration', 'trusted' );?>"><?php esc_html_e( 'User Registration', 'trusted' );?></a>
November 16, 2017 at 1:56 pm #2792Adri OosterwijkParticipantYeah!! Now it works, thanks a lot.
-
AuthorPosts
- The topic ‘Register link is (in my case) pointing to wrong page.’ is closed to new replies.