Help Customize Header - by jmann909 - on WordPress WooCommerce support

This topic has 13 replies, 2 voices, and was last updated 6 years ago ago by Rose Tyler

  • Avatar: jmann909
    jmann909
    Participant
    March 9, 2018 at 17:06

    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

    Please, contact administrator
    for this information.
    12 Answers
    Avatar: jmann909
    jmann909
    Participant
    March 9, 2018 at 17:09

    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!

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 12, 2018 at 09:52

    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

    Avatar: jmann909
    jmann909
    Participant
    March 12, 2018 at 12:14

    Thanks for the reply, can you be more specific what i add to advanced.php header?

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 13, 2018 at 08:18

    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

    Avatar: jmann909
    jmann909
    Participant
    March 13, 2018 at 15:23

    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

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 13, 2018 at 15:30

    Hello,

    Please compare code that you added and code that was provided.

    Regards

    Avatar: jmann909
    jmann909
    Participant
    March 13, 2018 at 16:12

    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:

    https://i.imgur.com/berVRJt.png

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 13, 2018 at 16:47

    Do you use latest theme version? Please provide us with your website URL so we can take a closer look.

    Regards

    Avatar: jmann909
    jmann909
    Participant
    March 13, 2018 at 23:48

    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.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 14, 2018 at 10:22

    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

    Avatar: jmann909
    jmann909
    Participant
    March 14, 2018 at 11:32

    Ok no problem. Thank you for the help.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    March 14, 2018 at 11:43

    You’re welcome!
    Have a nice day.

    Regards

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

You must be logged in to reply to this topic.Log in/Sign up

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