Home › Forums › Ticket Products › Event Tickets Plus › Limit ticket purchases to logged in users
- This topic has 7 replies, 2 voices, and was last updated 12 years ago by
Geoff.
-
AuthorPosts
-
September 11, 2014 at 7:40 am #737843
Cory
ParticipantIs there a hook that will allow me to wrap the tickets template with is_logged() or user role checking function? Please advise. Need to hide ticketing option for all non-members.
September 11, 2014 at 8:56 am #738015Geoff
MemberHey there Ryan!
Great question. Yes, you can customize the tickets template so the ticketing option is wrapped in a
is_logged()condition like that.You would want to add that condition in the class-wootickets.php template. Here’s the documentation for that template. I would also suggest checking out our Themer’s Guide to walk you through how to set up your own customizations without touching the core plugin.
Does that make sense? Will that work for you? Please let me know. Cheers!
Geoff
September 16, 2014 at 10:49 am #746614Cory
ParticipantSO I tried this in the views -> tickets.php file:
if ( $is_there_any_product ) {
?>
<h2 class=”tribe-events-tickets-title”><?php _e( ‘Reserve Spot’, ‘tribe-wootickets’ );?></h2>
<?php if ( is_logged() ) { ?>
<?php echo $contents; ?>
<?php if ( $is_there_any_product_to_sell ) { ?>
<tr>
<td colspan=”4″ class=’woocommerce’><button type=”submit” class=”button alt”><?php esc_html_e( ‘Add to cart’, ‘tribe-wootickets’ );?></button>
</td>
</tr>
<?php
}
}
else { ?>
<h4>You must be logged in as a Pro Stylist to request online reservations.</h4>
<?php
}}
}
?>September 16, 2014 at 2:11 pm #747049Geoff
MemberCool, did that end up doing the trick? If so, that would be helpful for other people looking for a similar solution.
September 18, 2014 at 1:07 pm #751393Cory
ParticipantWhen I added this all it did was hide the ticket form entirely. Any ideas here?
September 18, 2014 at 1:39 pm #751460Geoff
MemberIt looks like you may have an additional closing brackets on the end there. Is that the case?
September 19, 2014 at 8:29 am #753128Cory
ParticipantWorking now. Good catch. Thank you.
September 19, 2014 at 8:34 am #753141Geoff
MemberMy pleasure! Thanks again for reaching out and confirming that everything works. 🙂
I’m going to go ahead and close this thread, but please feel free to hit us back up if you run into any other questions.
Cheers!
Geoff -
AuthorPosts
- The topic ‘Limit ticket purchases to logged in users’ is closed to new replies.
