Support

Home Forums Event Espresso Premium Ticket option for manually added attendees

Ticket option for manually added attendees

Posted: April 24, 2014 at 3:44 am

Viewing 8 reply threads


Vittorio Pennazio

April 24, 2014 at 3:44 am

Hi, I’ve tried to follow what was explained here (https://eventespresso.com/topic/manually-added-attendees-are-shown-as-admin-under-option-rather-than-by-ticket/) but it did not really work, it still shows “Admin” as ticket option.

However, rather than having the default ticket to be added instead, is there a way I can simply change the “Admin” text appearing as ticket option to “Standard”, so “Standard” will appear on the ticket of those attendees rather than “Admin” or the default ticket option?

Thanks!


Vittorio Pennazio

April 24, 2014 at 3:48 am

Extra question on the matter: when I added an attendee manually, s/he is marked as “pending approval”. But if I then go and approve their registration request, then s/he will receive the e-mail asking to proceed with payment and so on, which would be confusing then. Is the are a way to set up that all manually added attendees are already approved (which would make good sense, since it’s already a staff member to register them)?
Thanks in advance for your help! ๐Ÿ™‚


Dean

April 24, 2014 at 4:02 am

Hi,

Not easily. The code by Sidney that you linked to is probably the best way to go about this right now.

I tested this out on EE version 3.1.36.5 and it worked perfectly.

How have you got this set up? Did you add the pluggable function to the core file? and the main function to a custom_functions.php file?


Vittorio Pennazio

April 24, 2014 at 4:23 am

Hi, thanks! Yes, I’ve added
if (!function_exists('add_new_attendee')) {
in line 2 and
}
at the very end of add_new_attendee.php

And then I’ve created a custom_functions.php placed in uploads/espresso/, with this:

<code>&lt;?php
function add_new_attendee($event_id){
	if (isset($_REQUEST[&#039;regevent_action_admin&#039;]) &amp;&amp; $_REQUEST[&#039;regevent_action_admin&#039;]== &#039;post_attendee&#039;){
		require_once(EVENT_ESPRESSO_PLUGINFULLPATH.&quot;includes/functions/attendee_functions.php&quot;);
		require_once(EVENT_ESPRESSO_PLUGINFULLPATH.&quot;includes/process-registration/add_attendees_to_db.php&quot;);
		$attendee_id = event_espresso_add_attendees_to_db();
 
		if ( $attendee_id ) {
			// SEND CONFIRMATION EMAIL MESSAGES
			event_espresso_email_confirmations(array(&#039;attendee_id&#039; =&gt; $attendee_id, &#039;send_admin_email&#039; =&gt; &#039;true&#039;, &#039;send_attendee_email&#039; =&gt; &#039;true&#039;));
			//echo $attendee_id;
			?&gt;
			&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;
			  &lt;p&gt;&lt;strong&gt;
			    &lt;?php _e(&#039;Added Attendee to Database&#039;,&#039;event_espresso&#039;); ?&gt;
			    &lt;/strong&gt;&lt;/p&gt;
			&lt;/div&gt;
		&lt;?php
		} else {
			global $notifications;
			$error_msg = implode( $notifications[&#039;error&#039;], &#039;&lt;br /&gt;&#039;);
			?&gt;
			&lt;div id=&quot;message&quot; class=&quot;error&quot;&gt;
				&lt;p&gt;
					&lt;strong&gt;&lt;?php echo $error_msg; ?&gt;&lt;/strong&gt;
				&lt;/p&gt;
			&lt;/div&gt;
			&lt;?php
		}
	}
	wp_register_script(&#039;reCopy&#039;, (EVENT_ESPRESSO_PLUGINFULLURL . &quot;scripts/reCopy.js&quot;), false, &#039;1.1.0&#039;);
        wp_print_scripts(&#039;reCopy&#039;);
 
	global $wpdb;
	$sql  = &quot;SELECT * FROM &quot; .EVENTS_DETAIL_TABLE. &quot; WHERE is_active=&#039;Y&#039; AND event_status != &#039;D&#039; AND id = &#039;&quot; . $event_id . &quot;&#039; LIMIT 0,1&quot;;
 
	//Build the registration page
	if ($wpdb-&gt;get_results($sql)){
			$events = $wpdb-&gt;get_results($sql);
			//These are the variables that can be used throughout the regsitration page
			foreach ($events as $event){
					$event_id = $event-&gt;id;
					$event_name = stripslashes($event-&gt;event_name);
					$event_desc = stripslashes($event-&gt;event_desc);
					$display_desc = $event-&gt;display_desc;
					$event_address = $event-&gt;address;
					$event_city = $event-&gt;city;
					$event_state = $event-&gt;state;
					$event_zip = $event-&gt;zip;
					$event_description = stripslashes($event-&gt;event_desc);
					$event_identifier = $event-&gt;event_identifier;
					$event_cost = isset($event-&gt;event_cost) ? $event-&gt;event_cost:&#039;&#039;;
					$member_only = isset($event-&gt;member_only) ? $event-&gt;member_only:&#039;&#039;;
					$reg_limit = isset($event-&gt;reg_limit) ? $event-&gt;reg_limit:&#039;&#039;;
					$allow_multiple = $event-&gt;allow_multiple;
					$start_date =  $event-&gt;start_date;
					$end_date =  $event-&gt;end_date;
					$reg_limit=$event-&gt;reg_limit;
					$additional_limit = $event-&gt;additional_limit;
					$is_active = array();
					$question_groups = unserialize($event-&gt;question_groups);
					//This function gets the status of the event.
					$is_active = event_espresso_get_is_active($event_id);
 
					//If the coupon code system is intalled then use it
					if (function_exists(&#039;event_espresso_coupon_registration_page&#039;)) {
						$use_coupon_code = $event-&gt;use_coupon_code;
					}
 
					//If the groupon code addon is installed, then use it
					if (function_exists(&#039;event_espresso_groupon_payment_page&#039;)) {
						$use_groupon_code = $event-&gt;use_groupon_code;
					}
 
					//Set a default value for additional limit
					if ($additional_limit == &#039;&#039;){
						$additional_limit = &#039;5&#039;;
					}
			}//End foreach ($events as $event)
 
 
			//This is the start of the registration form. This is where you can start editing your display.
			$num_attendees = get_number_of_attendees_reg_limit($event_id, &#039;num_attendees&#039;);//Get the number of attendees
			$available_spaces = get_number_of_attendees_reg_limit($event_id, &#039;available_spaces&#039;);//Gets a count of the available spaces
			$number_available_spaces = get_number_of_attendees_reg_limit($event_id, &#039;number_available_spaces&#039;);//Gets the number of available spaces
 
?&gt;
&lt;script&gt;$jaer = jQuery.noConflict();
	jQuery(document).ready(function($jaer) {
	jQuery(function(){
		//Registration form validation
		jQuery(&#039;#espresso-admin-add-new-attendee-frm&#039;).validate();
	});
});
 
	&lt;/script&gt;
&lt;div class=&quot;metabox-holder&quot;&gt;
  &lt;div class=&quot;postbox&quot;&gt;
    &lt;div id=&quot;espresso-admin-add-new-attendee-dv&quot;&gt;
 
        &lt;form method=&quot;post&quot; action=&quot;&lt;?php echo $_SERVER[&#039;REQUEST_URI&#039;]?&gt;&quot; onsubmit=&quot;return validateForm(this)&quot;  id=&quot;registration_form&quot; class=&quot;espresso_form&quot;&gt;
			&lt;?php wp_nonce_field(&#039;reg_nonce&#039;, &#039;reg_form_nonce&#039;);?&gt;
          &lt;h3 class=&quot;h3_event_title&quot; id=&quot;h3_event_title-&lt;?php echo $event_id;?&gt;&quot;&gt;&lt;?php echo $event_name?&gt;&lt;/h3&gt;
           &lt;div  class=&quot;padding&quot;&gt;
     	     &lt;div  class=&quot;inside&quot;&gt;
				&lt;fieldset&gt;
		 		&lt;h4 class=&quot;reg-quest-title section-title&quot;&gt;&lt;?php _e(&#039;Event Dates and Times&#039;,&#039;event_espresso&#039;); ?&gt;&lt;/h4&gt;
					&lt;p class=&quot;start_date&quot;&gt;
						&lt;span class=&quot;span_event_date_label&quot;&gt;&lt;?php _e(&#039;Start Date:&#039;,&#039;event_espresso&#039;); ?&gt;&lt;/span&gt;&lt;span class=&quot;span_event_date_value&quot;&gt;&lt;?php echo event_date_display($start_date)?&gt;&lt;/span&gt;
					&lt;/p&gt;
		          	&lt;p class=&quot;event_time&quot;&gt;
		            &lt;?php
						$time_selected =&#039;&#039;;
						//This block of code is used to display the times of an event in either a dropdown or text format.
						if (!empty($time_selected) &amp;&amp; $time_selected == true){//If the customer is coming from a page where the time was preselected.
							echo event_espresso_display_selected_time($time_id);//Optional parameters start, end, default
						}else if ($time_selected == false){
							echo event_espresso_time_dropdown($event_id);
						}//End time selected
						
						$results = $wpdb-&gt;get_results( $wpdb-&gt;prepare(&quot;SELECT price_type, member_price_type FROM &quot; . EVENTS_PRICES_TABLE . &quot; WHERE event_id=&#039;%d&#039; ORDER BY id ASC&quot;, $event_id) );
						echo &#039;&lt;label class=&quot;price_select&quot; for=&quot;price_option-&#039; . $event_id . &#039;&quot;&gt;&#039; . __(&#039;Choose a Ticket: &#039;, &#039;event_espresso&#039;) . &#039;&lt;/label&gt;&#039;;
						echo &#039;&lt;select name=&quot;seat_id&quot; id=&quot;price_option-&#039; . $event_id . &#039;&quot;&gt;&#039;;
						echo &#039;&lt;option value=&quot;&#039; . __(&#039;Admin&#039;, &#039;event_espresso&#039;) . &#039;&quot;&gt;&#039; . stripslashes_deep(__(&#039;Admin&#039;, &#039;event_espresso&#039;)) . &#039;&lt;/option&gt;&#039;;
						foreach($results as $price_line) {
							if(!empty($price_line-&gt;price_type)) {
								echo &#039;&lt;option value=&quot;&#039; . $price_line-&gt;price_type . &#039;&quot;&gt;&#039; . stripslashes_deep($price_line-&gt;price_type) . &#039;&lt;/option&gt;&#039;;
							}
							if(!empty($price_line-&gt;member_price_type)) {
								echo &#039;&lt;option value=&quot;&#039; . $price_line-&gt;member_price_type . &#039;&quot;&gt;&#039; . stripslashes_deep($price_line-&gt;member_price_type) . &#039;&lt;/option&gt;&#039;;
							}
						}
						echo &#039;&lt;/select&gt;&#039;;
					?&gt;
	          		&lt;/p&gt;
	          		&lt;?php
						// Added for seating chart addon
						do_action(&#039;ee_seating_chart_css&#039;);
						do_action(&#039;ee_seating_chart_js&#039;);
						do_action(&#039;ee_seating_chart_flush_expired_seats&#039;);
						do_action( &#039;espresso_seating_chart_select&#039;, $event_id);
			  		?&gt;
				&lt;/fieldset&gt;
			  &lt;?php
						echo event_espresso_add_question_groups( $question_groups, &#039;&#039;, null, 0, array(&#039;admin_only&#039;=&gt;true), &#039;inline&#039; );
 
						
						//Coupons
						if (function_exists(&#039;event_espresso_coupon_registration_page&#039;)) {
							echo event_espresso_coupon_registration_page($use_coupon_code, $event_id);
						}//End coupons display
 
						//Groupons
						if (function_exists(&#039;event_espresso_groupon_registration_page&#039;)) {
							echo event_espresso_groupon_registration_page($use_groupon_code, $event_id);
						}//End groupons display
 
 
	?&gt;
 
 
	          &lt;p class=&quot;event_form_field&quot;&gt;
	            &lt;label for=&quot;event_cost&quot; class=&quot;inline&quot;&gt;
	              &lt;?php _e(&#039;Amount Paid:&#039;,&#039;event_espresso&#039;); ?&gt;
	            &lt;/label&gt;
	            &lt;input tabindex=&quot;9&quot; type=&quot;text&quot; maxlength=&quot;10&quot; size=&quot;15&quot; name=&quot;event_cost&quot; id=&quot;event_cost-&lt;?php echo $event_id;?&gt;&quot; &lt;?php echo $event_cost ? &#039;value=&quot;&#039; . $event_cost . &#039;&quot;&#039; : &quot;&quot;; ?&gt; /&gt;
	            &lt;input type=&quot;hidden&quot; name=&quot;regevent_action_admin&quot; id=&quot;regevent_action-&lt;?php echo $event_id;?&gt;&quot; value=&quot;post_attendee&quot; /&gt;
	            &lt;input type=&quot;hidden&quot; name=&quot;event_id&quot; id=&quot;event_id-&lt;?php echo $event_id;?&gt;&quot; value=&quot;&lt;?php echo $event_id;?&gt;&quot; /&gt;
	            &lt;input type=&quot;hidden&quot; name=&quot;admin&quot; value=&quot;true&quot; /&gt;
	          &lt;/p&gt;
			 
			&lt;?php echo event_espresso_additional_attendees( $event_id, $additional_limit, $number_available_spaces, __(&#039;Number of Tickets&#039;, &#039;event_espresso&#039;), true, &#039;admin&#039;, &#039;inline&#039; );  ?&gt;
			
	          &lt;p class=&quot;event_form_submit&quot; id=&quot;event_form_submit-&lt;?php echo $event_id;?&gt;&quot;&gt;
	            &lt;input class=&quot;btn_event_form_submit button-primary&quot; id=&quot;event_form_field-&lt;?php echo $event_id;?&gt;&quot; type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;&lt;?php _e(&#039;Submit&#039;,&#039;event_espresso&#039;);?&gt;&quot; /&gt;
	          &lt;/p&gt;
	      &lt;/div&gt;
	      &lt;/div&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;?php
event_list_attendees();
	}//End Build the registration page
}</code>

But still it showed “Admin”. So I guess that the “Admin” text is not just written somewhere and could be changed to another value (ex. “Standard”)?


Lorenzo Orlando Caum

  • Support Staff

April 24, 2014 at 9:40 am

Hi there Vittorio,

The forums has made some adjustments to the code that you pasted so its difficult to read. Could you please upload a copy to a service like getcloudapp.com or tinygrab.com and link to it here?


Lorenzo


Vittorio Pennazio

April 24, 2014 at 9:48 am

Hi Lorenzo,

Sorry for the inconvenience. The first two lines of code seem to get visualised correctly (and that’s what I put on line 2 and at the very end of add_new_attendee.php) whereas, as the rest of it, I’ve created a custom_functions.php file (linked here: http://we.tl/gh8MhZ53jf) – which was nothing but a copy paste of what was reported on that topic, just added a php “opening” in line 1 to avoid a syntax error.

Thanks!


Tony

  • Support Staff

April 27, 2014 at 9:02 am

Hi Vittorio,

There seems to be some confusion on what that mod actually is intended for.

What that code does is allow you to chose a ticket option when manually adding an attendee. So for example, here is a default admin registration screen: http://take.ms/5fxMm

Adding an attendee using this screen shows this: http://take.ms/2YnpK

Then using the file you provided and modding the add_new_attendee.php file this is the new output for the registration screen: http://take.ms/9BXzD

The new dropdown will allow the admin to select the ticket type to assign to the user. For this event I have General Admission, and also a Memebers Admission. Which can be seen within the dropdown: http://take.ms/r7ZIs

So selecting the General Admission ticket and placing a registration with the Modified function, the registration will show the ticket the admin selected.

Placing the registration
http://take.ms/BDqgk

View the registration
http://take.ms/CCcL4

Previous registration made via the admin will not change, only registrations made from this point.

Does that help?


Vittorio Pennazio

April 28, 2014 at 2:09 am

Perfect, thanks! You are right, I’ve understood that the script would have changed those manual registrations to the default ticket, but instead adding the options of selecting the ticket type makes much more sense and works great!


Tony

  • Support Staff

April 28, 2014 at 4:56 am

Great!

I’m glad it works well for you.

Just let us know if you run into any other issues ๐Ÿ™‚

Viewing 8 reply threads

The support post ‘Ticket option for manually added attendees’ 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