Home › Forums › Legacy Support › Support queries › Styling issues › only show content box for non-logged in visitors
- This topic has 19 replies, 2 voices, and was last updated 4 years, 2 months ago by MeesterGijs.
-
AuthorPosts
-
January 20, 2020 at 7:27 pm #240004MeesterGijsSpectatorHello, 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, GijsJanuary 21, 2020 at 8:27 am #240079DianaParticipant@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 memberJanuary 21, 2020 at 8:34 pm #240145MeesterGijsSpectatorThank 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. ThanksJanuary 22, 2020 at 5:30 am #240173DianaParticipant@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 } }January 25, 2020 at 2:48 pm #240599MeesterGijsSpectatorI added the code in FTP (beacuse wplms customizer plugin gave me an error when adding this code; couldn't communicatie) but nothing happened. GijsJanuary 25, 2020 at 2:49 pm #240600MeesterGijsSpectatorThis reply has been marked as private.January 27, 2020 at 5:54 am #240672DianaParticipantThis reply has been marked as private.January 27, 2020 at 11:27 am #240718MeesterGijsSpectatorThat was already functional. What I want is that I don't want that content block visible when logged in. Is that possible?January 27, 2020 at 1:22 pm #240741DianaParticipant@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 siteJanuary 29, 2020 at 7:41 pm #240988MeesterGijsSpectatorI 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.January 30, 2020 at 8:11 am #241041DianaParticipantThis reply has been marked as private.January 30, 2020 at 10:16 am #241050MeesterGijsSpectatorThis reply has been marked as private.January 31, 2020 at 10:03 am #241131DianaParticipantThis reply has been marked as private.February 1, 2020 at 2:22 pm #241230MeesterGijsSpectatorIt works! Looks really clean. Btw, how can I get a little bit mor spacing above and underneath the grey text box? See screenshotFebruary 3, 2020 at 5:10 am #241273DianaParticipantThis reply has been marked as private.
-
AuthorPosts
- The topic ‘only show content box for non-logged in visitors’ is closed to new replies.