Home Forums Basel support forum Price Filter Ranges Reply To: Price Filter Ranges

#1223

Artem Temos
Keymaster

Unfortunately, there is no such ability by default in our theme. You can try to add the following code to your child theme functions.php file to achieve that

function basel_get_topbar_links() {
  $account_link = get_permalink( get_option('woocommerce_myaccount_page_id') );

  if( is_user_logged_in() ) {
    $links['my-account'] = array(
      'label' => esc_html__('My Account', 'basel'),
      'url' => $account_link
    );
  } else {
    $links['register'] = array(
      'label' => esc_html__('Login / Register', 'basel'),
      'url' => $account_link
    );
  }
  return $links;
}

add_filter( 'wp_nav_menu_items', 'basel_topbar_links', 10, 2 );
function basel_topbar_links ( $items = '', $args = array(), $return = false ) {
    if ( ( ! empty( $args ) && $args->theme_location == 'top-bar-menu' ) || $return ) {
    $links = basel_get_topbar_links();
    if( ! empty( $links )) {
      foreach ($links as $key => $link) {
        $items .= '<li id="menui-' . $key . '" class="menu-item item-event-hover">';
        $items .= '<a href="' . esc_url( $link['url'] ) . '">' . esc_attr( $link['label'] ) . '</a>';

        $items .= '</li>';
      }
    }

    }
    return $items;
}