Support

Home Forums Event Espresso Premium ticket capability for s2member level1/ 2/ 3 but not for free subscriber

ticket capability for s2member level1/ 2/ 3 but not for free subscriber

Posted: October 25, 2023 at 2:30 pm

Viewing 7 reply threads


igca

October 25, 2023 at 2:30 pm

I would like to Sell ticket to only paid members on our website. We are using s2member plugin to differentiate the membership level. I would like to sell them ticket at a special price but not to free subscribers. How can I achieve that?


Rio

  • Support Staff

October 25, 2023 at 9:39 pm

You might want to look on the discussion here.
https://eventespresso.com/topic/display-only-the-ticket-type-that-matches-the-user-role-for-ticket-selector/

there are also some code you can use there.

thanks


igca

October 25, 2023 at 11:10 pm

thanks for the response. I had another question, could I then limit the tickets sold per paid member to 2?


Tony

  • Support Staff

October 26, 2023 at 2:13 am

Hi there,

We don’t currently have a feature to set specific ticket limits like the above.

Would it would to remove the ticket from the ticket selector if the user has registered onto it before?

I have a snippet to do that here:

https://gist.github.com/Pebblo/eabb317ca126f5b298eca78755f2cbd1

You could then set the tickt to have a max qty of 2 f the user selects 1 or 2 tickets and registered with their own details the next time they view that ticket selector it wont show the ticket.


igca

October 30, 2023 at 5:38 am

Hi there, thanks for the above snippet but I would like to have the ticket displayed till the max limit is not reached. So for example the user buys 1 ticket and max allowed is 2, then he should be able to buy another one as well. Is that possible?
thanks!!


igca

October 30, 2023 at 6:07 am

also it should check that the registration status is approved.
something on these lines in your snippet:
array(
//’EVT_ID’ => $post->ID,
‘REG_deleted’ => false,
‘REG_status’ => ‘approved’,
‘TKT_ID’ => $ticket->ID()
‘TKT_QTY’ => $ticket->Quantity()
),


igca

October 30, 2023 at 8:04 am

I tried to implement this, will this work?

// does the user have a registration for this ticket?
$registration = $contact->get_many_related(
‘Registration’,
array(
array(
//’EVT_ID’ => $post->ID,
‘REG_deleted’ => false,
‘TKT_ID’ => $ticket->ID(),
‘STS_ID’ => EEM_Registration::status_id_approved
),
‘order_by’ => array(‘REG_date’ => ‘DESC’)
)
);

// if they already have a registration on this ticket, remove the ticket from the ticket selector.
if( count($registration) == 2 ) {
return ”;
}


Tony

  • Support Staff

October 30, 2023 at 8:37 am

Yes, that should work… however…. try

$contact->count_related() with the same parameters, that’ll pull a count in for you rather than initialising the objects just to count them.

Viewing 7 reply threads

The support post ‘ticket capability for s2member level1/ 2/ 3 but not for free subscriber’ 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.

Event Espresso