Posted: 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! |
|
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)? |
|
|
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? |
Hi, thanks! Yes, I’ve added And then I’ve created a custom_functions.php placed in uploads/espresso/, with this: <code><?php function add_new_attendee($event_id){ if (isset($_REQUEST['regevent_action_admin']) && $_REQUEST['regevent_action_admin']== 'post_attendee'){ require_once(EVENT_ESPRESSO_PLUGINFULLPATH."includes/functions/attendee_functions.php"); require_once(EVENT_ESPRESSO_PLUGINFULLPATH."includes/process-registration/add_attendees_to_db.php"); $attendee_id = event_espresso_add_attendees_to_db(); if ( $attendee_id ) { // SEND CONFIRMATION EMAIL MESSAGES event_espresso_email_confirmations(array('attendee_id' => $attendee_id, 'send_admin_email' => 'true', 'send_attendee_email' => 'true')); //echo $attendee_id; ?> <div id="message" class="updated fade"> <p><strong> <?php _e('Added Attendee to Database','event_espresso'); ?> </strong></p> </div> <?php } else { global $notifications; $error_msg = implode( $notifications['error'], '<br />'); ?> <div id="message" class="error"> <p> <strong><?php echo $error_msg; ?></strong> </p> </div> <?php } } wp_register_script('reCopy', (EVENT_ESPRESSO_PLUGINFULLURL . "scripts/reCopy.js"), false, '1.1.0'); wp_print_scripts('reCopy'); global $wpdb; $sql = "SELECT * FROM " .EVENTS_DETAIL_TABLE. " WHERE is_active='Y' AND event_status != 'D' AND id = '" . $event_id . "' LIMIT 0,1"; //Build the registration page if ($wpdb->get_results($sql)){ $events = $wpdb->get_results($sql); //These are the variables that can be used throughout the regsitration page foreach ($events as $event){ $event_id = $event->id; $event_name = stripslashes($event->event_name); $event_desc = stripslashes($event->event_desc); $display_desc = $event->display_desc; $event_address = $event->address; $event_city = $event->city; $event_state = $event->state; $event_zip = $event->zip; $event_description = stripslashes($event->event_desc); $event_identifier = $event->event_identifier; $event_cost = isset($event->event_cost) ? $event->event_cost:''; $member_only = isset($event->member_only) ? $event->member_only:''; $reg_limit = isset($event->reg_limit) ? $event->reg_limit:''; $allow_multiple = $event->allow_multiple; $start_date = $event->start_date; $end_date = $event->end_date; $reg_limit=$event->reg_limit; $additional_limit = $event->additional_limit; $is_active = array(); $question_groups = unserialize($event->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('event_espresso_coupon_registration_page')) { $use_coupon_code = $event->use_coupon_code; } //If the groupon code addon is installed, then use it if (function_exists('event_espresso_groupon_payment_page')) { $use_groupon_code = $event->use_groupon_code; } //Set a default value for additional limit if ($additional_limit == ''){ $additional_limit = '5'; } }//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, 'num_attendees');//Get the number of attendees $available_spaces = get_number_of_attendees_reg_limit($event_id, 'available_spaces');//Gets a count of the available spaces $number_available_spaces = get_number_of_attendees_reg_limit($event_id, 'number_available_spaces');//Gets the number of available spaces ?> <script>$jaer = jQuery.noConflict(); jQuery(document).ready(function($jaer) { jQuery(function(){ //Registration form validation jQuery('#espresso-admin-add-new-attendee-frm').validate(); }); }); </script> <div class="metabox-holder"> <div class="postbox"> <div id="espresso-admin-add-new-attendee-dv"> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']?>" onsubmit="return validateForm(this)" id="registration_form" class="espresso_form"> <?php wp_nonce_field('reg_nonce', 'reg_form_nonce');?> <h3 class="h3_event_title" id="h3_event_title-<?php echo $event_id;?>"><?php echo $event_name?></h3> <div class="padding"> <div class="inside"> <fieldset> <h4 class="reg-quest-title section-title"><?php _e('Event Dates and Times','event_espresso'); ?></h4> <p class="start_date"> <span class="span_event_date_label"><?php _e('Start Date:','event_espresso'); ?></span><span class="span_event_date_value"><?php echo event_date_display($start_date)?></span> </p> <p class="event_time"> <?php $time_selected =''; //This block of code is used to display the times of an event in either a dropdown or text format. if (!empty($time_selected) && $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->get_results( $wpdb->prepare("SELECT price_type, member_price_type FROM " . EVENTS_PRICES_TABLE . " WHERE event_id='%d' ORDER BY id ASC", $event_id) ); echo '<label class="price_select" for="price_option-' . $event_id . '">' . __('Choose a Ticket: ', 'event_espresso') . '</label>'; echo '<select name="seat_id" id="price_option-' . $event_id . '">'; echo '<option value="' . __('Admin', 'event_espresso') . '">' . stripslashes_deep(__('Admin', 'event_espresso')) . '</option>'; foreach($results as $price_line) { if(!empty($price_line->price_type)) { echo '<option value="' . $price_line->price_type . '">' . stripslashes_deep($price_line->price_type) . '</option>'; } if(!empty($price_line->member_price_type)) { echo '<option value="' . $price_line->member_price_type . '">' . stripslashes_deep($price_line->member_price_type) . '</option>'; } } echo '</select>'; ?> </p> <?php // Added for seating chart addon do_action('ee_seating_chart_css'); do_action('ee_seating_chart_js'); do_action('ee_seating_chart_flush_expired_seats'); do_action( 'espresso_seating_chart_select', $event_id); ?> </fieldset> <?php echo event_espresso_add_question_groups( $question_groups, '', null, 0, array('admin_only'=>true), 'inline' ); //Coupons if (function_exists('event_espresso_coupon_registration_page')) { echo event_espresso_coupon_registration_page($use_coupon_code, $event_id); }//End coupons display //Groupons if (function_exists('event_espresso_groupon_registration_page')) { echo event_espresso_groupon_registration_page($use_groupon_code, $event_id); }//End groupons display ?> <p class="event_form_field"> <label for="event_cost" class="inline"> <?php _e('Amount Paid:','event_espresso'); ?> </label> <input tabindex="9" type="text" maxlength="10" size="15" name="event_cost" id="event_cost-<?php echo $event_id;?>" <?php echo $event_cost ? 'value="' . $event_cost . '"' : ""; ?> /> <input type="hidden" name="regevent_action_admin" id="regevent_action-<?php echo $event_id;?>" value="post_attendee" /> <input type="hidden" name="event_id" id="event_id-<?php echo $event_id;?>" value="<?php echo $event_id;?>" /> <input type="hidden" name="admin" value="true" /> </p> <?php echo event_espresso_additional_attendees( $event_id, $additional_limit, $number_available_spaces, __('Number of Tickets', 'event_espresso'), true, 'admin', 'inline' ); ?> <p class="event_form_submit" id="event_form_submit-<?php echo $event_id;?>"> <input class="btn_event_form_submit button-primary" id="event_form_field-<?php echo $event_id;?>" type="submit" name="Submit" value="<?php _e('Submit','event_espresso');?>" /> </p> </div> </div> </form> </div> </div> </div> <?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”)? |
|
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? — |
|
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! |
|
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 View the registration Previous registration made via the admin will not change, only registrations made from this point. Does that help? |
|
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! |
|
Great! I’m glad it works well for you. Just let us know if you run into any other issues ๐ |
|
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.