User role on my-account page - by Krzysztof

This topic has 5 replies, 2 voices, and was last updated 4 years, 6 months ago ago by Krzysztof

  • Avatar: Krzysztof
    Krzysztof
    Participant
    June 2, 2021 at 20:39

    Is there a chance to display user role somewhere on on my-account woocommerce page ?
    if not by default or by some simple snippet, please advise where i can find a my-account template to modify ?

    4 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Participant
    June 3, 2021 at 12:31

    Hello,

    We don’t have the option to display the user role on my account page.
    You can implement this by additional customization only, use WooCommerce hooks https://www.businessbloomer.com/woocommerce-visual-hook-guide-account-pages/ to display additional information on my account page.

    Regards

    Avatar: Krzysztof
    Krzysztof
    Participant
    June 3, 2021 at 18:49

    thx for tip 🙂
    i put simple snippet:

    function action_woocommerce_before_account_navigation(  ) { 
    	echo "test333";
    }; 
             
    add_action( 'woocommerce_before_account_navigation', 'action_woocommerce_before_account_navigation', 10, 0 ); 

    but unfortunately my text does not show before navigation but before content: https://snipboard.io/ar0HBV.jpg

    any idea what am I doing wrong 🙂 thank you in advance for your kind help

    Avatar: Olga Barlow
    Olga Barlow
    Participant
    June 4, 2021 at 13:27

    Hello,

    Because this is inline string. Use div tag
    echo '<div>test333</div>';
    and it will appear before the navigation.

    Regards

    Avatar: Krzysztof
    Krzysztof
    Participant
    June 7, 2021 at 18:29

    thx … works 🙂

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘User role on my-account page’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.