Hide block in logout - by mohamed aly - on WordPress WooCommerce support

This topic has 4 replies, 2 voices, and was last updated 2 years, 1 months ago ago by Rose Tyler

  • Avatar: mohamed aly
    mohamed aly
    Participant
    November 17, 2022 at 13:23

    Hi
    how we can hide products block in my account page in logout https://prnt.sc/xy50FtMJnZ8g

    3 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    November 17, 2022 at 15:24

    Hello,

    Add a custom class for row, for example:
    disable-for-non-logged-in
    https://prnt.sc/TtV5ygwXJfk1
    then add the next code in custom CSS for the page

    .disable-for-non-logged-in {
        display: none !important;
    }

    https://prnt.sc/NU51uRRHyIFf

    Regards

    Avatar: mohamed aly
    mohamed aly
    Participant
    November 18, 2022 at 13:50

    Hi
    we add class name disable-for-non-logged-in in products block https://prnt.sc/fSRDLth8IZTq then add this code in my account page setting
    https://prnt.sc/AjviFPppmeOy the result products block is hidden for login and out user , pls check

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    November 18, 2022 at 13:56

    Hello,

    You are right, please change the code to –

    body:not(.logged-in) .disable-for-non-logged-in {
        display: none !important;
    }

    Regards

  • Viewing 4 results - 1 through 4 (of 4 total)

The issue related to '‘hide block in logout’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.