• Resolved Lee

    (@leecollings)


    Hey,

    I’m trying to find either a function (or shortcode) to display the My Account navigation menu items in a place where I like (outside of the usual myaccount template).

    This is mainly for an optimised mobile navigation interface, so I just need a single call to display the my account menu items.

    Can anyone tell me how to do this?

    <a
    <?php if(!is_user_logged_in()) {
    echo 'href="'.wc_get_page_permalink('myaccount').'" ';
    } else {
    echo 'href="#collapseAccountMenu" data-bs-toggle="collapse" role="button" aria-expanded="false" aria-controls="collapseAccountMenu" ';
    } ?>
    class="btn btn-link btn-lg text-capitalize text-decoration-none fs-3 px-0"
    >
    <span class="fa-solid fa-user fa-lg"></span>
    <?php if(!is_user_logged_in()) { ?>
    Sign in / Register
    <?php } else if(isset(get_userdata(get_current_user_id())->first_name)) {
    echo 'Hi, '.get_userdata(get_current_user_id())->first_name.'! <span class="fa-solid fa-caret-down fa-fw"></span>';
    } else {
    echo 'Welcome back! <span class="fa-solid fa-caret-down fa-fw"></span>';
    } ?>
    </a>
    <div class="collapse" id="collapseAccountMenu">
    <p>Collapsed User Menu here...</p>
    </div>
Viewing 1 replies (of 1 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    I understand your concern. However, please note that we do not provide support for customizations. If you need more in-depth support or want to consider professional assistance for customization, I can recommend WooExperts and Codeable.io as options for getting professional help. Alternatively, you can also ask your development questions in the  WooCommerce Community Slack as custom code falls outside our usual scope of support.

    Thank you

Viewing 1 replies (of 1 total)

The topic ‘How to display MyAccount navigation menu?’ is closed to new replies.