Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › Add Shopping Cart to Header-6
New Landing › How can we help? › Themeforest Theme Support › Dante › Add Shopping Cart to Header-6
- This topic has 17 replies, 5 voices, and was last updated 10 years by Mohammad – SUPPORT.
-
Posted in: Dante
-
March 18, 2014 at 4:59 pm #58745
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.
Thanks,
BrittanyMarch 19, 2014 at 8:47 am #58853Hi, 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
March 19, 2014 at 7:42 pm #59125any code you can recommend to do so?
Thanks,
BrittanyMarch 20, 2014 at 11:32 am #59323Hi,
Please provide worpdress admin login detail so i may try to change this .Thanks
March 20, 2014 at 3:37 pm #59456This reply has been marked as private.March 20, 2014 at 3:40 pm #59457And 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!
March 20, 2014 at 4:15 pm #59482Hi,
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;}
March 20, 2014 at 4:50 pm #59514OMG awesome!!!!! Looks like it works.
Thank you thank you thank you.
March 20, 2014 at 4:51 pm #59516Question, when I update the theme i need to manually put back in that code into the main themes file sf-header.php?
Thanks again!
March 20, 2014 at 5:15 pm #59525Hi,
Please first activate child theme and put this code in functions.php of child themefunction 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 IdeasMarch 21, 2014 at 11:40 pm #59806One 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.comThanks,
BrittanyMarch 22, 2014 at 8:55 pm #59913NVM I resolved, woocommerce was disabled.
Thanks,
BrittanyMarch 23, 2014 at 9:58 am #59941HI,
I’m glad that your sorted it .Thanks 🙂
With Best Regards
Swift IdeasOctober 5, 2014 at 7:56 am #117304Hi 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!
MHCAttachments:
You must be logged in to view attached files.October 5, 2014 at 7:58 am #117306This reply has been marked as private. -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.