This topic has 13 replies, 2 voices, and was last updated 6 years, 8 months ago ago by Rose Tyler
Hello I was advised to post my request here.
Here’s my request:
Currently I’m using the ADVANCED HEADER TYPE what I want to do is add the SIGNIN/MYACCOUNT icon before the cart button.
see image to better understand –
I’m sure that’s very possible, I just don’t know which file I need to edit.
Thank You
I forgot to mention that it would be better if instead of text it will be an icon. e.g if person is not logged in use e.g fontawesome register/sign in icon, then if the person is logged in use the head like icon.
Thanks!
Hello,
You can edit header structure file depending on header type that you use, in your case, it is xstore/headers/advanced.php. Do all the changes in child theme files.
Regards
Thanks for the reply, can you be more specific what i add to advanced.php header?
Add this code in functions.php file of child theme:
function etheme_shop_navbar( $location = 'header', $exclude = array(), $force = false ) {
$args['wishlist'] = ( ! in_array( 'wishlist', $exclude ) && etheme_woocommerce_installed() && etheme_get_option( 'top_wishlist_widget' ) == $location ) ? true : false ;
$args['search'] = ( ! in_array( 'search', $exclude ) && etheme_get_option( 'search_form' ) == $location ) ? true : false;
$args['cart'] = ( ! in_array( 'cart', $exclude ) && etheme_woocommerce_installed() && ! etheme_get_option( 'just_catalog' ) && etheme_get_option( 'cart_widget' ) == $location ) ? true : false ;
if ( ! $args['wishlist'] && ! $args['search'] && ! $args['cart'] && ! $force ) return;
do_action( 'etheme_before_shop_navbar' );
echo '<div class="navbar-header show-in-' . $location . '">';
echo '<a href="'.get_permalink( get_option('woocommerce_myaccount_page_id') ).'">';
if ( is_user_logged_in() ) {
echo '<i class="fa fa-user" aria-hidden="true"></i>';
}
else {
echo 'Sing in or create account';
}
echo '</a>';
if( $args['search'] ) etheme_search_form();
if( $args['wishlist'] ) etheme_wishlist_widget();
if( $args['cart'] ) etheme_top_cart();
echo '</div>';
do_action( 'etheme_after_shop_navbar' );
}
logged in http://prntscr.com/iq6rzg
unlogged http://prntscr.com/iq6slp
Regards
Hello im getting this error:
Your PHP code changes were rolled back due to an error on line 18 of file wp-content/themes/x2/functions.php. Please fix and try saving again.
syntax error, unexpected '&'
image = https://i.imgur.com/Dl8464I.png
Hello,
Please compare code that you added and code that was provided.
Regards
Thank you it works but the problem is when i hover over the icon it doesnt work the way the myaccount works that is located to the top menu. There are no dropdown links similar to the image below:
Do you use latest theme version? Please provide us with your website URL so we can take a closer look.
Regards
I’m using v4.21 is that the latest? I do not see any update on my backend, also as of now, my website is hosted on a local development so it’s not yet online.
Btw, on your demo when you hover the mouse does it works, the drop down links?
This line of code – echo ‘‘;
Is it not this code only suppose to output the url for the wocommerce account, and it’s not similar to the sign in link on the header that involves other links when mouse is hovered?
Thank You so much for your patience, I really appreciate it.
Hello,
Sorry, but it is a bit difficult to help you without the possibility to see your site. Could you please contact us once you move the site to live server?
Also, soon (within a few days) will be released a new theme update, where we are planning to add more options for the header so maybe the desired result will be achieved on our site without customization only using Theme Options.
Regards
Ok no problem. Thank you for the help.
You’re welcome!
Have a nice day.
Regards
You must be logged in to reply to this topic.Log in/Sign up