Adding Woocommerce checkout/cart links to the nav bar

Are you using WooCommerce on your wordpress site? Want to add checkout, cart  or even price to your navigation? 

Here is a quick code snippet on how to get it done. Open your nav template file and paste it after your nav menu links.  If you are using roots wordpress theme it will be header-top-navbar.php and you can add it at the bottom of the file before the nav closing tag. If you are not using roots you can edit your header.php file and look for a place right after menu stopped printing usually you can paste this right before the </nav> closing tag

The code below will create a wordpress login/logout button, as well as cart link (with quantity and total price) + checkout button

woocommerce-cart

The picture above doesn’t show a checkout link, however the code below will create it as well. If you don’t need it just comment it out

Hope this helps!

While we are on WooCommerce subject check out our WooCommerce optimization guide