Okay
  Public Ticket #3176049
Registration Link
Closed

Comments

  •  3
    wiredphteam started the conversation

    Hi, 
    Just wanted to ask on how can i change the Registration link, Instead of routing it to My Account(default), i wanted to route it somewhere else(like a registration page), Please see attached image as reference. 

    Thanks and more power..

    Attached files:  2022-11-27_184353.png

  •  1,904
    WebWizards replied

    Hi there,

    You can do that with the following PHP code snippet:

    add_filter('salesking_registration_page_link', function($link){
        $agent_id = get_user_meta(get_current_user_id(), 'salesking_agentid', true);
        $link = get_permalink( 12345 );
        
        $link.= '?regid='.$agent_id;
        return $link;
        
    }, 10, 1);
    

    In the above snippet, you can replace 12345 with the ID of your custom registration page (to get a page ID see https://webstick.blog/get-page-id-wordpress )


    A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/


    Kind regards,

    Stefan