New Landing How can we help? Themeforest Theme Support Dante Hide Menu Cart When Not Logged In

Viewing 7 posts - 1 through 7 (of 7 total)
  • Posted in: Dante
  • #125493
    crease
    Member
    Post count: 101

    To add products to my cart the customer has to be a logged in but the cart still shows if not logged in.

    Is there a way to hide the cart until a user is signed up or logged in?

    #125511
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Try adding this to your custom css:

    body:not(.logged-in) .top-header-menu .menu .shopping-bag-item {
      display: none;
    }

    – Kyle

    #125512
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Inside the file dante\includes\sf-header.php

    Find this line of code:

    
    if (sf_woocommerce_activated()) {
    

    and replace by this one

    
    if (sf_woocommerce_activated() && is_user_logged_in() ) {
    

    -Rui

    #125533
    crease
    Member
    Post count: 101

    It worked with the css for both the cart and the wishlist…

    … would the sf-header.php option be better?

    #125537
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Yes it would, but make sure you copy the whole function in that file into your child theme functions.php file. That way is just a bit more complicated

    – Kyle

    #125545
    crease
    Member
    Post count: 101

    That didn’t work, I will stick to the css option. Thanks.

    #125547
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Ok no problem

    – Kyle

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register