only show content box for non-logged in visitors

Home Forums Legacy Support Support queries Styling issues only show content box for non-logged in visitors

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #240004
    MeesterGijs
    Spectator
    Hello, I have created a notification at the checkout page: "Members that want to extend their subscription should log in before paying." How do I get the text and the grey box only to show when a non-logged in visitor goes to https://meestergijs.nl/checkout/ (with product in basket)  image Thanks, Gijs
    #240079
    Diana
    Participant
    @MeesterGijs, Add this code in wp-admin > Plugins > Editor > wplms customizer plugin > wplms-customizer.php add_action('woocommerce_before_checkout_form','show_before_woocommerce_checkout_form'); function show_before_woocommerce_checkout_form(){ if(!is_user_logged_in()){ //Add your code here } } Add your code to show that banner. It will be visible only to non logged in member
    #240145
    MeesterGijs
    Spectator
    Thank you, Diana. I can't seem to get it to work. I have no clear idea how to do this. Could you help? It's this block and this one. Thanks
    #240173
    Diana
    Participant
    @MeesterGijs, I don't have your FTP/Cpanel credentials so not able to add the code in wplms customizer plugin. Please add this code, it will show the exact block for non-logged in users on the checkout page add_action('woocommerce_before_checkout_form','show_before_woocommerce_checkout_form'); function show_before_woocommerce_checkout_form(){ if(!is_user_logged_in()){ ?> <h5 style="text-align: center;"><span style="color: #fff;">Heb je al een abonnement en kom je deze verlengen? </span></h5> <p style="text-align: center;"><span style="color: #3f3f3f;">Zorg dat je bent <a href="https://meestergijs.nl/wp-login.php">ingelogd</a> voordat je gaat betalen.</span></p> <?php } }
    #240599
    MeesterGijs
    Spectator
    I added the code in FTP (beacuse wplms customizer plugin gave me an error when adding this code; couldn't communicatie) but nothing happened. Gijs
    #240600
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #240672
    Diana
    Participant
    This reply has been marked as private.
    #240718
    MeesterGijs
    Spectator
    That was already functional. What I want is that I don't want that content block visible when logged in. Is that possible?
    #240741
    Diana
    Participant
    @MeesterGijs, This Page: https://meestergijs.nl/checkout/ created by you using page builder. Edit your page and remove this. I didn't have your correct credentials with me so I can't check this on your site
    #240988
    MeesterGijs
    Spectator
    I did what you've told me to. I see it only copied 1 sentence, not the entire grey box, including the grey box itself. And it's positioned wrong. I want the grey box including 2 sentences visible for non-logged in visitors and not visible for logged in members. Watch out: I changed it back after deleting the code, so now it is visible for both; logged in and not-logged in.
    #241041
    Diana
    Participant
    This reply has been marked as private.
    #241050
    MeesterGijs
    Spectator
    This reply has been marked as private.
    #241131
    Diana
    Participant
    This reply has been marked as private.
    #241230
    MeesterGijs
    Spectator
    It works! Looks really clean. Btw, how can I get a little bit mor spacing above and underneath the grey text box? See screenshot
    #241273
    Diana
    Participant
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 20 total)
  • The topic ‘only show content box for non-logged in visitors’ is closed to new replies.