Hiding ALL cart from menu when logged out
-
I am trying to hide the Cart for the menu when users are logged out. I found this (see below) which would work if I was not using the Fly out part of the plugin, it leaves the icon and allows the dropdown and links for when cart is empty to still work.
add_filter(‘wpmenucart_menu_item_a_content’, ‘wpmenucart_only_logged_in’, 10, 4);
function wpmenucart_only_logged_in( $link_content, $menu_item_icon, $cart_contents, $item_data ) {
if (!is_user_logged_in()) {
$link_content = ”;
}
return $link_content;
}
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Hiding ALL cart from menu when logged out’ is closed to new replies.