Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.