Support

Home Forums Event Espresso Premium Member-Only Tickets – Hide from General/Public View

Member-Only Tickets – Hide from General/Public View

Posted: September 22, 2015 at 4:26 pm


Joe Z

September 22, 2015 at 4:26 pm

We’re using the Roles and Permissions plugin to make some special tickets only available to Administrators. This lets us manually handle certain special discounted tickets that are only purchased through special arrangement. (And we’d rather not use the Promo codes for this because our client has an easier time just picking the special rates from the list.)

The problem is, EE4 show member-only tickets to everyone, only preventing the purchase by non-authorized members. (“The [ticket name & rate] is available to members only” appears in the ticket selector, even to logged out users.) I realize this can be good for promotion, but, there are lots of use cases when people might want to advertise such tickets.

A CSS-styling suggestion had been made in the forum elsewhere and that’s great, except, it’s dependent on the exact name of the ticket, which means I would need to be called in everytime to hide a ticket. This is unsustainable.

May I suggest, then, at least adding a special classname onto member-only tickets in the ticket selector? At least this way CSS can target all member-only tickets.

In the future, it would be great if the Advanced settings of the ticket selector allowed member-only tickets to be shown or hidden for “nonqualified” users!


Joe Z

September 22, 2015 at 4:36 pm

Update: I was able to accomplish something like this using POEdit and a translations file, finding the line for “The %1$s%2$s%3$s%4$s is available to members only. %5$s” and wrapping that with “<span class=’member-ticket’>”, and then applying the appropriate CSS to hide the line.

I had already made extensive changes to the PO file so it made sense to do it this way, however, for users who don’t need to worry about translations, it would still be great for EE to handle adding the class (or the option on individual member tickets.)


Joe Z

September 22, 2015 at 7:43 pm

I now see another thread on this that suggests using a naming convention for the tickets (e.g., “Admin Only – xyz”) and using CSS3 *= selectors to hide that line, looking for -admin-only in the classname.

https://eventespresso.com/topic/admin-only-tickets/

Both of these solutions are a little less than ideal because the lines are only hidden by CSS, so the internal pricing information is still being revealed and is accessible by search engines, etc.


Josh

  • Support Staff

September 23, 2015 at 8:10 am

Hi Joe Z,

There’s a PHP based solution that doesn’t involve using CSS. Here’s a link to some instructional code that shows how:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/jf_ee_password_protect_ticket.php


Joe Z

September 23, 2015 at 3:00 pm

Hi Josh–Thanks for that. That could work for situations where there are consistent, long-term tickets to be setup that way. For clients who have a rolling program of events, ultimately, please consider a feature request of adding a “Hide from unauthorized users” checkbox functionality to the User Capabilities tickets. 🙂

Thanks!


Josh

  • Support Staff

September 23, 2015 at 4:36 pm

Hi Joe,

As you can imagine, if we added a checkbox for every possible option, EE would have a lot of options for everything. So while we can carefully consider your feature request, I can’t promise that it’s something we’ll add.

Here’s a code snippet that’s based on what I posted earlier that has a few tweaks so it automatically not display the member only tickets to logged out users that you can use by adding to your site’s functions file:

function espresso_vip_tickets_displayed( $ticket_row_html, EE_Ticket $ticket ) {
    $cap_required = $ticket->get_extra_meta( 'ee_ticket_cap_required', true );
    if ( empty( $cap_required ) ) {
        return false;
    }
    if ( ( is_admin() && ! EE_FRONT_AJAX ) || ! empty( $cap_required ) && is_user_logged_in() &&  EE_Registry::instance()->CAP->current_user_can( $cap_required, 'wp_user_ticket_selector_check' ) ) {
        return false; //cap required but user has access so continue on please.
    } 
    $ticket_row_html = '';
    return $ticket_row_html;
}
add_filter( 'FHEE__ticket_selector_chart_template__do_ticket_entire_row', 'espresso_vip_tickets_displayed', 10, 2 );


Joe Z

September 23, 2015 at 6:46 pm

Thanks that is awesome.

As a developer, I of course understand that you cannot be expected to add every single configuration permutation in the interface. I only ask that you consider it because:

a) there are a couple of other threads–including some very old ones–with users asking for this functionality; it is a major additional feature (“hidden tickets”) enabled by one option.

b) you already provide options like “display expired tickets,” etc, so you’re aware users are likely to have preferences about whether different types of unavailable items are visible–this is no different.

Anyway, thanks for considering it.


Josh

  • Support Staff

September 24, 2015 at 7:46 am

Yeah we are aware that everyone has their preferences about how, what, where, and when things should be displayed. So try to make the default decisions based on the majority of the use cases we see, and then we add filters and sometimes options to allow preferences to be satisfied.


IanWatson

October 7, 2015 at 1:42 pm

My two cents…

Other ticketing systems that I’ve used in the past all have a “Hidden Ticket” check-box option that works amazingly well.

I would really like this functionality as well.

What I would suggest as an added bonus would be to maintain the “user capability to purchase ticket” field with a “Hidden From Others” check-box beside it.

That way you have the option to keep the ticket available and encourage people to become members.

Or hide it.

On a ticket-by-ticket basis so that you can create both a members ticket and a hidden admin only sponsor’s ticket or something.

As I dive deeper and deeper into EE4 it’s become clear that I will no longer be using any other ticketing system. EE4 has been developed so well, fulfilling almost all of me needs.

Thank you for all the amazing work!!


Jonathan Wilson

October 7, 2015 at 4:02 pm

Hello Joe and Ian,

Thanks for your input. I have created a feature request on our public roadmap. You can cast your votes for that enhancement here: https://trello.com/c/TGMGEPXK

The support post ‘Member-Only Tickets – Hide from General/Public View’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Jonathan Wilson 3 years, 11 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!