New Landing How can we help? Themeforest Theme Support Dante Add Shopping Cart to Header-6

Viewing 15 posts - 1 through 15 (of 18 total)
  • Posted in: Dante
  • #58745
    bamtron
    Member
    Post count: 17

    Is there a CSS workaround to modify one of these headers to look like Header-6 but include the shopping cart at the very left? See attached image.

    I need the menu to have the logo, main menu and shopping cart in one line and sticky. I am willing to modify the theme files, but would like to look for a CSS customization option first.

    http://seedycoffee.com/

    Thanks,
    Brittany

    #58853
    Melanie – SUPPORT
    Member
    Post count: 11032

    Hi, I’m afraid you cannot make the shopping cart icon appear with custom css, you will need to modify the php code for that.

    Cheers

    #59125
    bamtron
    Member
    Post count: 17

    any code you can recommend to do so?

    Thanks,
    Brittany

    #59323
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide worpdress admin login detail so i may try to change this .

    Thanks

    #59456
    bamtron
    Member
    Post count: 17
    This reply has been marked as private.
    #59457
    bamtron
    Member
    Post count: 17

    And I just realized I said above to have the cart at the left. I meant the RIGHT. Sorry! Please see the screen grab for exactly how I want it to lay out. Thank you so much!

    #59482
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    I have done it so please check .

    REMARK CODE -: sf-header.php at line 412
    $menu_with_search_output .= sf_get_cart() . "\n";
    
    Custom CSS
    .header-3 #main-navigation, .header-4 #main-navigation, .header-5 #main-navigation, .header-6 #main-navigation, .header-7 #main-navigation{margin-right:70px;}
    
    #59514
    bamtron
    Member
    Post count: 17

    OMG awesome!!!!! Looks like it works.

    Thank you thank you thank you.

    #59516
    bamtron
    Member
    Post count: 17

    Question, when I update the theme i need to manually put back in that code into the main themes file sf-header.php?

    Thanks again!

    #59525
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please first activate child theme and put this code in functions.php of child theme

    function sf_main_menu($id, $layout = "") {
    		
    			// VARIABLES
    			$options = get_option('sf_dante_options');
    			$show_cart = $options['show_cart'];
    			$show_wishlist = $options['show_wishlist'];
    			$header_search_type = "search-1";
    			$disable_megamenu = false;
    			if (isset($options['header_search_type'])) {
    				$header_search_type = $options['header_search_type'];
    			}
    			if (isset($options['disable_megamenu'])) {
    				$disable_megamenu = $options['disable_megamenu'];
    			}
    			$menu_output = $menu_full_output = $menu_with_search_output = "";
    			$main_menu_args = array(
    				'echo'            => false,
    				'theme_location' => 'main_navigation',
    				'walker' => new sf_mega_menu_walker,
    				'fallback_cb' => ''
    			);
    			
    			
    			// MENU OUTPUT
    			if ($disable_megamenu) {
    			$menu_output .= '<nav id="'.$id.'" class="std-menu clearfix">'. "\n";					
    			} else {
    			$menu_output .= '<nav id="'.$id.'" class="mega-menu clearfix">'. "\n";		
    			}
    			
    			if(function_exists('wp_nav_menu')) {
    				if (has_nav_menu('main_navigation')) {
    					$menu_output .= wp_nav_menu( $main_menu_args );
    				}
    				else {
    					$menu_output .= '<div class="no-menu">'.__("Please assign a menu to the Main Menu in Appearance > Menus", "swiftframework").'</div>';
    				}
    			}
    			$menu_output .= '</nav>'. "\n";
    			
    			
    			// FULL WIDTH MENU OUTPUT
    			if ($layout == "full") {	
    				
    				$menu_full_output .= '<div class="container">'. "\n";
    				$menu_full_output .= '<div class="row">'. "\n";
    				$menu_full_output .= '<div class="menu-left">'. "\n";
    				$menu_full_output .= $menu_output . "\n";
    				$menu_full_output .= '</div>'. "\n";
    				$menu_full_output .= '<div class="header-right">'. "\n";
    				$menu_full_output .= '<nav class="std-menu">'. "\n";			
    				$menu_full_output .= '<ul class="menu">'. "\n";
    				if ($header_search_type == "search-1") {
    				$menu_full_output .= '<li class="menu-search parent"><a href="#" class="header-search-link"><i class="ss-search"></i></a></li>'. "\n";
    				} else if ($header_search_type == "search-2") {
    				$menu_full_output .= '<li class="menu-search parent"><a href="#" class="header-search-link-alt"><i class="ss-search"></i></a>'. "\n";
    				$menu_full_output .= '<div class="ajax-search-wrap"><div class="ajax-loading"></div><form method="get" class="ajax-search-form" action="'.home_url().'/"><input type="text" placeholder="'.__("Search", "swiftframework").'" name="s" autocomplete="off" /></form><div class="ajax-search-results"></div></div>'. "\n";
    				$menu_full_output .= '</li>'. "\n";			
    				}
    				if ($show_cart) {
    				$menu_full_output .= sf_get_cart();
    				}
    				if ( class_exists( 'YITH_WCWL_UI' ) && $show_wishlist)  {
    				$menu_full_output .= sf_get_wishlist();
    				}
    				$menu_full_output .= '</ul>'. "\n";
    				$menu_full_output .= '</nav>'. "\n";
    				$menu_full_output .= '</div>'. "\n";
    				$menu_full_output .= '</div>'. "\n";
    				$menu_full_output .= '</div>'. "\n";
    				
    				$menu_output = $menu_full_output;
    			
    			} else if ($layout == "with-search") {
    				
    				$menu_with_search_output .= '<nav class="search-nav std-menu">'. "\n";			
    				$menu_with_search_output .= '<ul class="menu">'. "\n";
    				if ($header_search_type == "search-1") {
    				$menu_with_search_output .= '<li class="menu-search parent"><a href="#" class="header-search-link"><i class="ss-search"></i></a></li>'. "\n";
    				} else if ($header_search_type == "search-2") {
    				$menu_with_search_output .= '<li class="menu-search parent"><a href="#" class="header-search-link-alt"><i class="ss-search"></i></a>'. "\n";
    				$menu_with_search_output .= '<div class="ajax-search-wrap"><div class="ajax-loading"></div><form method="get" class="ajax-search-form" action="'.home_url().'/"><input type="text" placeholder="'.__("Search", "swiftframework").'" name="s" autocomplete="off" /></form><div class="ajax-search-results"></div></div>'. "\n";
    				$menu_with_search_output .= '</li>'. "\n";
                                    $menu_with_search_output .= sf_get_cart() . "\n";
    				}
    				$menu_with_search_output .= '</ul>'. "\n";
    				$menu_with_search_output .= '</nav>'. "\n";
    				$menu_with_search_output .= $menu_output . "\n";
    				
    				
    				$menu_output = $menu_with_search_output; 
    				
    			}
    			
    			// MENU RETURN		
    			return $menu_output;
    		}

    Thanks
    With Best Regards
    Swift Ideas

    #59806
    bamtron
    Member
    Post count: 17

    One issue. Tried doing this into my other site and its not working. Darn!

    Pasted sf_get_cart in the sf-header.php (in Dante main theme). Also pasted the longer code the in child theme functions.php.

    Same login above for the /wp-admin/
    http://faultlinecollective.com

    Thanks,
    Brittany

    #59913
    bamtron
    Member
    Post count: 17

    NVM I resolved, woocommerce was disabled.

    Thanks,
    Brittany

    #59941
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    HI,
    I’m glad that your sorted it .

    Thanks 🙂
    With Best Regards
    Swift Ideas

    #117304
    MHC
    Member
    Post count: 247

    Hi Mohammad,

    I’m trying to do the same, so followed your instruction by adding $menu_with_search_output .= sf_get_cart() . "\n"; to wp-content/themes/dante/includes/sf-header.php (kindly see attached screenshot)

    Also added the custom CSS:
    .header-3 #main-navigation, .header-4 #main-navigation, .header-5 #main-navigation, .header-6 #main-navigation, .header-7 #main-navigation{margin-right:70px;}

    However, that doesn’t seem to work. Could you let me know where I did wrong?

    Thanks so much!
    MHC

    Attachments:
    You must be logged in to view attached files.
    #117306
    MHC
    Member
    Post count: 247
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register