regarding post: https://kriesi.at/support/topic/woocommerce-login-on-top/
Using this adds login/logout to avia2 for WP itself. How do you modify this to log in/out of the WooCommerce account?
SOLVED:
I added the following to functions.php.
/*
* Add WooCommerce Login/Logout to avia2 menu
*/
add_filter( 'wp_nav_menu_items', 'add_loginout_link', 10, 2 );
function add_loginout_link( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'avia2') {
$items .= '<li><a href="'. get_permalink( wc_get_page_id( 'myaccount' ) ) .'">My Account</a></li>';
$items .= '<li><a href="'. wp_logout_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ) .'">Log Out</a></li>';
}
elseif (!is_user_logged_in() && $args->theme_location == 'avia2') {
$items .= '<li><a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">Log In/Register</a></li>';
}
return $items;
}