Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-sales domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the better-click-to-tweet domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-amazon domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the pue-stats domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/staging-poc/public_html/wp-includes/functions.php on line 6114
Manually added attendees are shown as 'admin' under option rather than by ticket | Event Espresso - Staging Server

Support

Home Forums Event Espresso Premium Manually added attendees are shown as 'admin' under option rather than by ticket

Manually added attendees are shown as 'admin' under option rather than by ticket

Posted: January 31, 2014 at 4:44 am

Viewing 19 reply threads


Nicholas

January 31, 2014 at 4:44 am

Hi

My client always has to manually add a certain number of attendees to every event for whatever reason (people sending in cheques etc). Going through a payment or invoice gateway automatically provides the purchased ticket type under the option field in the attendee overview but manually added members simply say ‘admin’.

They need to export this data to their CRM system and want the ticket purchased type to show – I’ve looked at the edit attendee and it shows the correct ticket type but I can’t see why that isn’t transferred.

Thanks


Nicholas

January 31, 2014 at 5:01 am

I shouldn’t keep answering my own questions but I’ve found that if I change from Default Pricing to Member Pricing and select the ticket type that is then saved.

This is a bit of a bug because the default pricing might have ticket types that aren’t identical to member pricing.


Anonymous

January 31, 2014 at 5:27 am

Hi Nicholas,

If you edit the attendee and just click ‘Update Record’, that should update the ticket to the one currently selected, you shouldn’t need to change the Pricing Option.

I’ve opened a ticket to discuss this with a note to update this thread with the outcome.


Nicholas

January 31, 2014 at 5:35 am

Ok, so simply clicking on ‘update record’ does work – I think it just looks as though that is already selected. I will advise the client of the procedure, thanks a lot.


Nicholas

January 31, 2014 at 6:03 am

As I suspected, the client is whining that this is now a two-stage process and why can’t this be on one page when adding the attendee. Any ideas?


Anonymous

January 31, 2014 at 6:08 am

I noticed an issue whilst testing this with Multi Attendee Registrations that I think is worth noting for yourself.

If an Admin adds multiple attendees to a registration (an event with at least Personal Information Required for additional attendees). The price input for the Paid amount on the registration then applies to all of those attendees. When the ticket is Admin, it shouldn’t effect anything, but if you do the above and then Update the price on the registration, the price will be calculated incorrectly for that registration.

This does NOT apply if this is a single registration with multiple ticket quantity. (events that do NOT require additional attendee info)

We have a ticket for this to be looked into further by a developer.


Anonymous

January 31, 2014 at 6:28 am

As I suspected, the client is whining that this is now a two-stage process and why can’t this be on one page when adding the attendee. Any ideas?

Currently not unfortunately.

I’ll investigate and see what we can do.


Nicholas

January 31, 2014 at 6:42 am

What they want is to see the ticket types at the ‘add attendee’ stage. It does make sense but whether it’s possible, thanks for looking into it


Sidney Harrell

  • Support Staff

February 4, 2014 at 11:57 am

You might be able to take advantage of the post-save-attendee hook to modify the saved attendee if it was created by the admin to a default ticket type. Take a look at what I did here: https://gist.github.com/sidharrell/7163075, but instead of checking for is_primary, you would check for ‘payment’ == ‘Admin’, and if true change the price_option to some default value.


Sidney Harrell

  • Support Staff

February 4, 2014 at 12:58 pm

I took a little deeper look at how the attendee is added by the admin, and was able to take advantage of a quirk in the code. The following is a guide to adding what you are looking for. Take note of the comments, as they are instructions for where to add the bits of code:

// unfortunately, the function does not currently have a pluggable function wrapper,
// so the best course of action right now is to add the pluggable function wrapper in core,
// then add the overriding function into a custom function holding location.
// so in includes/admin-reports/add_new_attendees.php add this as line 2:
if (!function_exists('add_new_attendee')) {
// then add the closing brace at the end of the file:
}
// that way, whenever the client updates and loses the custom functionality, all you need to do is
// add the pluggable function wrapper back in. And in a future update, we will probably add the
// pluggable function wrapper in.
// that done, you can add this to a custom plugin, or uploads/espresso/custom_functions.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
}
view raw gistfile1.txt hosted with ❤ by GitHub


Nicholas

February 6, 2014 at 8:05 am

thanks, would it work to drop the code into a new custom_functions.php file that I add to the EE folder? I’m pretty good on the old CSS but don’t get involved in coding (just yet). Thanks


Anonymous

February 6, 2014 at 8:57 am

Hi Nicholas,

That’s the best place for that function :)

The actual function starts at line 21 to the end of that gist, place that in the custom_functions.php file.

You could actually add all of it as the first few lines are comments describing how to add the check the overrides the original function to core but either way you need to perform the first steps outlined or you will receive a fatal error stating you can not re-declare a function.

Hope that helps.


Anonymous

February 6, 2014 at 9:00 am

Think I maye have misread your question.

Create a file called custom_functions.php in wp-content/uploads/espresso/ and add the function there, if you already have that file just add the function to the end.


Nicholas

February 6, 2014 at 4:08 pm

so there is nothing else I need to do besides add the function code to the file or are any additional modifications required?


Sidney Harrell

  • Support Staff

February 6, 2014 at 9:24 pm

I put in the comments at the top the only modifications that you need to make to core. You’ll need to add:

if (!function_exists('add_new_attendee')) {

to the top of plugins/event-espresso/includes/admin-reports/add_new_attendees.php
and a closing brace:

}

to the end of it. Then the rest of that code, which is the customized version of that function, can be added to uploads/espresso/custom_functions.php.


Nicholas

February 7, 2014 at 5:55 am

Am I right in thinking that I’ll have to add that line of code to the core after every update?


Anonymous

February 7, 2014 at 7:49 am

Hi Nicholas,

For the time being yes, however we have created a ticket to include this within future versions of Event Espresso.


Nicholas

February 16, 2014 at 12:48 pm

Thanks, I managed to get this to work and the ticket types now appear in a drop down whilst in the ‘add attendee’ area


Dean

  • Support Staff

February 17, 2014 at 4:24 am

Hi Nicholas,

Can this thread be marked as resolved?


Nicholas

February 17, 2014 at 4:26 am

Hi Dean, yes you can mark resolved, it’s working ok

Viewing 19 reply threads

The support post ‘Manually added attendees are shown as 'admin' under option rather than by ticket’ 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 - Staging Server