Skip to content

Instantly share code, notes, and snippets.

@secretstache
Created April 8, 2015 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save secretstache/e9ae542a3ad5486bccfb to your computer and use it in GitHub Desktop.
Save secretstache/e9ae542a3ad5486bccfb to your computer and use it in GitHub Desktop.
Cart 66 Shortcode for View Cart
//Filter Through Store Nav
add_filter( 'wp_nav_menu_items', 'ssm_append_store_navigation', 10, 2 );
function ssm_append_store_navigation ( $items, $args ) {
if ( do_shortcode('[cc_cart_item_count]') == 1 ) {
$cart_item = '<li class="right cart"><a href="' . get_bloginfo('url') . '/view_cart/">' . do_shortcode('[cc_cart_item_count]') . ' Item</a></li>';
} else {
$cart_item = '<li class="right cart"><a href="' . get_bloginfo('url') . '/view_cart/">' . do_shortcode('[cc_cart_item_count]') . ' Items</a></li>';
}
if ( $args->theme_location == 'ssm-store' ) {
$items .= $cart_item;
}
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment