Support

Home Forums Event Espresso Premium Signup problems

Signup problems

Posted: May 5, 2020 at 8:02 am


gschwarz

May 5, 2020 at 8:02 am

Good day,

I am currently implementing Event Espresso in a Theme to provide easy signups to an event.

What I currently have is a page (https://paschul.webdesign-berlin.de/schulung/anaphylaxieschulung/). I have also created an Event with the same name as this page and have created a few (2) event dates and 2 tickets (each for a single event date).

I have looped the event dates on the page, but I cannot make the registration button to appear, no matter what I try.

I tried espresso_ticket_selector( $post ), but it echoes all tickets, not the ones that I have prior set up to be assigned to a single event date.

The question at hand is how this could be arranged, if at all, that each datetime in a loop shows 1 ticket, that is assigned to it before?

Thanks in advance!


Seth Shoultes

  • Support Staff

May 5, 2020 at 8:17 am

Hi there,

Can you please share the code here that you are trying to add to your page?


gschwarz

May 5, 2020 at 8:37 am

Hello Seth,

I have modified the content-espresso_events-shortcode.php template (by copying it in my theme) with the following code:


$datetimes = EEH_Event_View::get_all_date_obj( $post->ID, false );
//print_r($datetimes);
foreach($datetimes as $datetime){
	//print_r($datetime);
	$placesLeft = $datetime->reg_limit() - $datetime->sold();
	echo '<tr>';
		echo '<td>';
			echo $datetime->name();
		echo '</td>';

		echo '<td>';
			if(date('d.m.Y', $datetime->start()) == date('d.m.Y', $datetime->end())){
				echo date('d.m.Y', $datetime->start());
			}else{
				echo date('d', $datetime->start()) . ' - ' . date('d.m.Y', $datetime->end());
			}
		echo '</td>';

		if($placesLeft == 0){
			echo '<td class="ausgebucht">';
				echo '<span>Ausgebucht</span>';
			echo '</td>';
		}elseif($placesLeft < 4){
			echo '<td class="orange-btn">';
				echo '<span>' . $placesLeft . '</span>';
			echo '</td>';
		}else{
			echo '<td class="green-btn">';
				echo '<span>' . $placesLeft . '</span>';
			echo '</td>';
		}

		echo '<td>';
			//espresso_ticket_selector( $post );
		echo '</td>';

	echo '</tr>';
}

This makes the table at the bottom of the page I have provided.

The problem is that I cannot display a registration button or form at single rows.


Tony

  • Support Staff

May 5, 2020 at 9:00 am

Hi there,

Currently, I don’t think we have a method to do this.

To confirm I understand, you are trying to output a register button for each individual ticket within an event?

So something like this: https://monosnap.com/file/FhhvdHpAk4zHZwDzKYav1w5B4Q0MuR

Where each register button is for a specific ticket within the same event?


gschwarz

May 5, 2020 at 9:19 am

Hello Tony,

yes, that is what I have been trying to do. I have also tried to retrieve the data directly from the database, but I didnt manage to find anything.

What would probably help me is if you could tell me where espresso_ticket_selector() is defined, that way I can write a function of my own that retrieves one with the same title as the line item.

Thanks in advance!


Tony

  • Support Staff

May 5, 2020 at 9:23 am

espresso_ticket_selector( $event = NULL ) is a template tag, so thats in:

\event-espresso-core-reg\public\template_tags.php

That calls EED_Ticket_Selector::display_ticket_selector( $event );

Which lives in event-espresso-core-reg\modules\ticket_selector\EED_Ticket_Selector.module.php

There’s a fair amount of customizations you’ll need to do what you need as you need to supply SPCO with the correct values to process the ticket although it is doable.

The support post ‘Signup problems’ 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