Hide/restrict access to a ticket type

Home Forums Ticket Products Event Tickets Plus Hide/restrict access to a ticket type

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #62745
    rhomedia
    Participant

    Hi

    I am using WooCommerce Subscriptions and Groups to create a subscription based site. I want to have one ticket type per event that is only available to paid members, i.e. hidden from others.

    Could you point me in the direct of the WooTickets code I would need to adapt to achieve the above?

    Thanks.
    Richard

    #63118
    Kelly
    Participant

    Hi, Richard. I think I understand what you’re getting at.

    This sounds like something that would be implemented in the WooCommerce side of things, rather than in our code, which basically allows easy integration with the WooCommerce functionality. Have you had a chance to get in touch with their support?

    We did have someone last month who was talking about doing something similar: https://theeventscalendar.com/support/forums/topic/wootickets-with-member-and-public-pricing-for-one-event/ You might check that out for ideas, too.

    Hope that all makes sense. Thanks for being a TEC user!

    #63122
    Barry
    Member

    Hi Richard: just to add, a short snippet like this will hide/remove the ticket form:

    remove_action('tribe_events_single_event_after_the_meta', array(TribeWooTickets::get_instance(), 'front_end_tickets_form'));

    So you could use that conditionally, given a piece of code that detects if the current user is indeed a certain category of member, ie:

    if (false === is_customer_type('gold_customer')) {
    remove_action('tribe_events_single_event_after_the_meta', array(TribeWooTickets::get_instance(), 'front_end_tickets_form'));
    }

    The opening line – the is_customer_type() function – is of course something I just made up, you’d need to devise your own equivalent (or work with the relevant plugin authors to build it) but hopefully it gives you a broad idea of how this might be done.

    A more comprehensive solution might additionally include a check run when items are added to the cart to provide more complete protection – however that sort of customization really relates to WooCommerce and we’d have to leave it to you to develop a solution there, too, though perhaps the team over at WooThemes could help with that.

    Hope that gives you some ideas 🙂

    #63979
    rhomedia
    Participant

    Kelly, Barry

    Thanks.

    @Barry – I guess your code hides the whole form, rather than just one ticket type, which is what I want to achieve. It is useful, nevertheless.

    rt.

    #64047
    Kelly
    Participant

    No problem, rt. Glad we could help!

    #64091
    Barry
    Member

    Hi rhomedia, just to add that I see what you mean now and the code to hide the entire ticket form probably isn’t suitable. So, in your case, essentially you could instead get close to what you want by overriding and customizing wootickets/tickets.php (please see the Themer’s Guide for details).

    For instance, within the code used to loop through the available tickets (lines 13-77, within the default version of the template) you could perform an additional check, perhaps against the presence or value of some post meta data attached to each ticket product, and decide to show or hide the ticket on that basis.

    The actual implementation is something we’d need to leave to you, however 🙂

    #980557
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Hide/restrict access to a ticket type’ is closed to new replies.