This topic has 2 replies, 2 voices, and was last updated 10 years by Mj.

  • Author
  • #22659
     Mj
    Participant

    Hello,

    I do like to know how to hide the ‘shopping-cart’ from guests (not logged in users), because the shop is only activated for our users. Any suggestions are appreciated.

    Thanks

    #23080
     Catalin
    Moderator

    Hello,

    add this code in your functions.php file from your child theme:

    COPY CODE
    
    
    function kleo_woo_header_cart ( $items, $args )
    {
        $cart_location = sq_option( 'woo_cart_location', 'primary' );
    
        if ( $args->theme_location == $cart_location )
        {
            if ( is_user_logged_in() )
            {
                $items .= kleo_woo_get_mini_cart();
            }
        }
           return $items;
    
    }
    
    
    

    let me know if this works

    Thank you,
    Catalin

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #23089
     Mj
    Participant

    Thanks, it’s working!

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Hide shop button for guests’ is closed to new replies.

Log in with your credentials

Forgot your details?