Home Forums WoodMart support forum Remove two section

Remove two section

Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #52263

    wanila
    Participant

    hello!

    I want to remove two section of my website theme. but not with css! I mean i want to remove them completely from the codes …

    1. The number near cart icon in header ( i mean the number that shows how many products is in the user cart )
    2. The dropdown in the bottom of account icon for logged in users ( i mean the dropdown in header that shows downloads … addresses … logout … and more )

    Which files i must edit for these two?
    Thank you.

    #52285

    Artem Temos
    Keymaster

    Hello,

    You can find these elements and remove completely from the code in the file inc/template-tags.php.

    Regards

    #52428

    wanila
    Participant

    Thank you. Could you please highlight and send me screenshots of the codes that i must remove?
    + Just please remember, in my second question, i want to remove the dropdown in mobile menu too

    #52434

    Artem Temos
    Keymaster
    #52447

    wanila
    Participant

    Sorry, but one more question

    For my second question, should i remove this function completely? http://s6.uplod.ir/i/00919/eufyw59lqwih.png

    or i should only remove the lines that you sent me?
    cause i found that there are some more codes in the end of that function that you didn’t highlight …

    #52467

    Artem Temos
    Keymaster

    Try to empty the body of the function. It means just leave it empty.

    #52472

    wanila
    Participant

    you mean i should remove all the codes of that function, and only let this highlighted section ( http://s6.uplod.ir/i/00919/eufyw59lqwih.png ) to be there?

    #52480

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    	function woodmart_get_header_links() {
    		$links = array();
    
    		if( ! woodmart_woocommerce_installed() ) return $links;
    
    		$login_dropdown = woodmart_get_opt( 'login_dropdown' );
    		$links_with_username = woodmart_get_opt( 'links_with_username' );
    		$color_scheme = whb_get_dropdowns_color();
    
        	if( whb_is_enabled() ) {
        		$settings = whb_get_settings();
    			$login_dropdown = isset( $settings['account'] ) && $settings['account']['login_dropdown'] && ( ! $settings['account']['form_display'] || $settings['account']['form_display'] == 'dropdown' );
        		$links_with_username = isset( $settings['account'] ) && $settings['account']['with_username'];
        	}
    
    		$account_link = get_permalink( get_option('woocommerce_myaccount_page_id') );
    
    		$current_user = wp_get_current_user();
    
    		if( is_user_logged_in() ) {
    			$links['my-account'] = array(
    				'label' => esc_html__('My Account', 'woodmart'),
    				'url' => $account_link,
    				'dropdown' => ''
    			);
    			if ( $links_with_username ) {
    				$links['my-account']['label'] = sprintf( esc_html__( 'Hello, %s', 'woodmart' ), '<strong>' . esc_html( $current_user->display_name ) . '</strong>' );
    			}
    		} else {
    			$links['register'] = array(
    				'label' => esc_html__('Login / Register', 'woodmart'),
    				'url' => $account_link
    			);
    
    			if( $login_dropdown ) {
    				$links['register']['dropdown'] = '
    					<div class="sub-menu-dropdown color-scheme-' . $color_scheme . '">
    						<div class="login-dropdown-inner">
    							<h3 class="login-title"><span>' . esc_html__('Sign in', 'woodmart') . '</span><a class="create-account-link" href="' . esc_url( $account_link ) . '">' . esc_html__('Create an Account', 'woodmart') . '</a>' . '</h3>
    							' . woodmart_login_form( false, $account_link ) . '
    						</div>
    					</div>
    				';
    			}
    		}
    
    		return apply_filters( 'woodmart_get_header_links',  $links );
    	}
    #54960

    wanila
    Participant

    Sorry, but could i remove the whole “My account menu” function completely?
    Is there anything wrong with that?

    #54986

    Artem Temos
    Keymaster

    Sorry, but we don’t understand what do you mean. Did you try the solution we gave you?

    #55019

    wanila
    Participant

    I explain my problem from the start …

    I want to remove the dropdown menu for LOGGED IN users. ( I mean the menu that appear under the “My Account” icon in header … )
    So my question is, can i remove the “my account menu” function in the “template-tags.php” file completely?

    + here is two screenshot of the codes that i want to remove them from template-tags.php file:
    1. http://uupload.ir/files/9e87_a1.jpg
    2. http://uupload.ir/files/aku_a2.jpg

    Is it right to remove these highlighted code completely?

    #55028

    Artem Temos
    Keymaster

    Try to leave this function empty. If you will remove them completely, you will get a Fatal error.

    #55033

    wanila
    Participant

    So you mean i remove the whole code of that function, and just let this section be there:

    // **********************************************************************//
    // ! My account menu
    // **********************************************************************//

    Am i right?

    #55035

    Artem Temos
    Keymaster

    No, you need to leave the function empty function woodmart_get_header_links() {}

    #55041

    wanila
    Participant

    im so sorry, but i dont understand what should i do 🙁
    here is my template-tags.php file. could you please change this file in the correct way and send it to me? thank you so much

    #55042

    Artem Temos
    Keymaster

    In this case, please, provide us your FTP access.

    #55043

    wanila
    Participant
    #55044

    wanila
    Participant

    please send me your ip

    #55052

    wanila
    Participant

    Thank you. please check the private section

    #55055

    Artem Temos
    Keymaster

    Please, check now.

    #55063

    wanila
    Participant

    thank you so much. which files did you edited for this one?

    #55090

    Artem Temos
    Keymaster

    We edited the file inc/template-tags.php.

Viewing 22 posts - 1 through 22 (of 22 total)