Home Forums Trusted Pro Register link is (in my case) pointing to wrong page.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #2773
    Adri Oosterwijk
    Participant

    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

    #2775
    Adri Oosterwijk
    Participant

    Made 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 } ?>

    #2777
    Adri Oosterwijk
    Participant

    Silly, 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.

    #2779
    Andy
    Keymaster

    Yopu 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.

    #2783
    Adri Oosterwijk
    Participant

    Thanks 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

    #2784
    Andy
    Keymaster

    Sorry 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>

    #2785
    Adri Oosterwijk
    Participant

    Hi 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.

    #2786
    Andy
    Keymaster

    if 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>

    #2787
    Adri Oosterwijk
    Participant

    Yeah 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.

    #2788
    Andy
    Keymaster

    Am I understanding correctly that it is the register link in the header that you want to change?
    See image below

    #2789
    Adri Oosterwijk
    Participant

    Yeah, that’s the one.
    I just flushed the caches, topped the server, restarted my machine but it is still behaving badly. Naughty link….

    #2790
    Andy
    Keymaster

    There 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.

    #2791
    Andy
    Keymaster

    You 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>

    #2792
    Adri Oosterwijk
    Participant

    Yeah!! Now it works, thanks a lot.

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Register link is (in my case) pointing to wrong page.’ is closed to new replies.