Posted: March 4, 2014 at 7:51 pm
|
Hello, ——————- When I set events to be “Member Only” I receive the message that I must be logged in. ——————- Hi, 1) Either via the language files ( https://eventespresso.com/wiki/how-to-change-wording-with-poedit/ ) or via editing a core file (not recommended) – member_functions.php in the espresso-members plugin. 2) Yes but you will need to edit the registration_page_display.php template to both allow the description to show and most likely embed the add to cart shortcode directly there so you can do a check to see if members only (it will be harder to check and show/hide it if it is in the description). If PHP isn’t your thing, we have a list of recommended developers here – https://eventespresso.com/developers/event-espresso-pros/ |
|
Hi, I drafted something up here – https://gist.github.com/Apina/2b513fff0d801b9c98e5 It can replace the entirety of the registration_page.php file (copy the registration_page.php and registration_page_display.php files FROM event-espresso/templates/ TO wp-content/uploads/espresso/templates and then repalce the file content there). This is based on version 3.1.3.64 You will need the WP User Integration (Members) plugin active and the event needs to be marked as Members only. You will then see this on the Event List – http://take.ms/moaLP and this on the registration page http://take.ms/NZpk1 |
|
I appreciate the help with this. I’ve noticed 3 things. I am on Version 3.1.36.4.P |
|
Sorry, this is the Logged in image… |
Hi Jeffrey, I’ll try to follow up with each of these below:
Does this happen if you remove the code modifications? You might get an error message to display in you enable WP_DEBUG that can clue us in on what’s going on.
Yes it can. One way to do this is copy over the add to cart code from event_list_display.php over to registration_page_display.php
This looks like a float isn’t getting cleared in one case, and possibly and unclosed div. Can you post a link to the page so we can examine the source of the page? |
|
|
I’ll try to follow up with each of these below:
Yes, when the code modifications are gone (removing the two files from the uploads/espresso/templates directory) I do not get the white screen. When I set debug I see no error message.
I’ve been having trouble getting the code to display the “add to cart” button. My variables in the events should be all correct. Is there just a simple line of code that would force the button on all events? If so, would you mind sending it?
I removed the class clearfix in a div and this is working now. |
|
Additional Info on #2: When I comment out multi_reg (see code below) the “add to cart” button appears. I have the “Multiple Event Reg” add on and enabled and it’s working great with the short code so I don’t know why it shows when this is removed. Anyway, even though it now shows the button.. when clicked it does not re-direct to the cart like the short code does. It just shows the spinning circle forever. Another thing.. When I click the Short code “add to cart” button that now just sits and spins as well. When I remove the two files out of the uploads/espresso/templates directory the short code button functions once again. |
|
Here are the two files… |
Hi Jeffrey, Have you tried doing a diff comparing the code that we ship with your customized code? Generally speaking we do not support customized template modifications. If your custom code is causing fatal errors, it’s outside of what we support. |
|
|
I got close to figuring this out but anytime the add to cart link was clicked it just sat and spun in circles. I did however find another work around so if anyone is desiring this functionality here it is… I totally removed the member add-on and used a simple wp function to check to see if the user is logged in. Inside this I placed a wp shortcode function to place the add to cart shortcode. The below was placed in this file (registration_page_display.php). <code><?php if (is_user_logged_in() ) { //only logged in user can see this ?> <div><br/> <?php echo do_shortcode("[ESPRESSO_CART_LINK anchor='Add to cart' direct_to_cart=1 moving_to_cart='Redirecting to cart...']"); ?><br/><br/> </div> <?php } else { ?> <div><br/> <i>You must be logged in to register.</i> <br/><br/> </div> <?php } ?> </code> |
|
That last post didn’t display very well so here is it again. Hopefully it displays the code. <?php if (is_user_logged_in() ) { //only logged in user can see this ?> |
|
Hi Jeffrey, Glad that you got it figured out in the end and thanks for sharing your solution. |
The support post ‘ONLY Hiding the Add to Cart link when viewing member events’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.