New Landing How can we help? Atelier Hide all pricing and Add to Cart button for non-members

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Atelier
  • #187186
    lucas7700
    Member
    Post count: 28

    Hello,

    I am looking for the ability to hide all pricing in my store including the add to cart button for users that are not logged in. So this function would allow the general public to browse the items in the store, but would be unable to see pricing or make a purchase unless they have an account and are logged in.

    I have added some css that hides the pricing in the product listing and product detail pages, but still displays the add to cart button and allows the user to place an item in cart, which still displays the price.

    Appreciate any help with this. Thanks in advance!!

     

    #187462
    David Martin – Support
    Moderator
    Post count: 20834

    Hey Lucas,

    If you have added some CSS already then it sounds like you this should help you:

    WordPress adds the class .logged-in if any user is logged in, so with that you can switch between hiding content or displaying it. Ex below:

    .yourclass { display: none; }

    body.logged-in .yourclass { display: block; }

    Thanks,
    David.

    #187704
    lucas7700
    Member
    Post count: 28

    Thanks David, but I’m still having trouble getting this to work. Perhaps there is a more simple solution – basically I would just like the site to function like this: Users that are not logged in (public) would see only the “Catalog Mode” of the site – no prices or cart buttons. Users that are logged in (private) would have the non-catalog mode of the site with pricing and cart buttons.

    So, is there a way to simply enable “Catalog Mode” for public and disable it for private?

    Hope this makes sense.

    Thanks so much!

    #187865
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    The above CSS should do it, can you show me what you have tried? Likely I can provide you with some helper CSS.

    Also can you add your URL and login details?

    Thanks,
    David.

    #206945
    lucas7700
    Member
    Post count: 28
    This reply has been marked as private.
    #207021
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this custom css code:-

    .price,.add_to_cart_button{ display: none; }
    
    body.logged-in .price, body.logged-in .add_to_cart_button{ display: block; }

    Thanks
    Mohammad

    #209449
    lucas7700
    Member
    Post count: 28
    This reply has been marked as private.
    #209514
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove last css code and use this new code:-

    .price,.add_to_cart_button{ display: none; }
    body.logged-in .price, body.logged-in .add_to_cart_button{ display: block !important; }
    

    Thanks
    Mohammad

Viewing 8 posts - 1 through 8 (of 8 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