I have searched the forums, but haven’t been able to find a solution to show the price that my attendee(s) paid or how they paid in the registration confirmation email that is sent to the admin (me). I read that you can add that info in the functions/email.php section and I have done that, but it still isn’t showing up on the email confirmation. Please advise, I was hoping to take this live soon.
Yes sorry payment method. I have the “Cost” showing in the email confirmation that the attendee gets, just not in the admin email that my registrar gets.
Make sure that you make the changes to the espresso_prepare_admin_email function. /includes/functions/email.php has several functions that apply to different emails. If you’d like someone to make these customizations for you, you might try posting an ad on the job board or purchase a support token.
I would just like someone to tell where to add this one piece of code to add the total amount paid and payment method to the email.php page. I don’t understand why it has to be so complicated. I’m sorry but I am going to have to search the forums some more for an answer, I don’t have the resources to for someone to customize this. I see everywhere where to remove the cost/ event price, but no where to add it. That just seems strange to me. Thank you!
There are a bunch of emails that get handled in the /functions/email.php file. It’s possible that the one you added the cost to was the wrong one or that you’re calling a variable that hasn’t been defined in that function. Can you post your code and where you put it in your email.php? Also, we don’t recommend modifying the core Event Espresso files unless you are using the custom files add-on because your modifications will be lost when you upgrade.
Trust me I don’t like making changes to the core files either, so I have downloaded the custom files and will upload that after i receive info back from you.
`get_results( $sql );
if ( NULL !== $rs && count( $rs ) > 0 ) {
$result = true;
} elseif ( ‘espresso_group_admin’ == espresso_member_data( ‘role’ ) &&
( isset( $espresso_manager[ ‘event_manager_venue’ ] ) && “y” == strtolower( $espresso_manager[ ‘event_manager_venue’ ] ) )
) {
$group = get_user_meta( espresso_member_data( ‘id’ ), “espresso_group”, true );
$group = unserialize( $group );
if (is_array( $group ) && count( $group ) > 0 ) {
$sql = ” SELECT * FROM ” . EVENTS_VENUE_TABLE . ” v LEFT JOIN ” . EVENTS_LOCALE_REL_TABLE . ” lr ON v.id = lr.venue_id WHERE v.id = ‘” . $venue_id . “‘ AND lr.locale_id IN (” . implode( ‘,’, $group ) . “) “;
$rs = $wpdb->get_results( $sql );
if ( NULL !== $rs && count( $rs ) > 0 ) $result = true;
}
}
}
return $result;
}
}
if ( !function_exists( ‘espresso_venue_dd’ ) ){
function espresso_venue_dd($current_value=0){
global $espresso_premium; if ($espresso_premium != true) return;
global $wpdb, $espresso_manager, $current_user;
$WHERE = " WHERE ";
$sql = "SELECT ev.*, el.name AS locale FROM " . EVENTS_VENUE_TABLE . " ev ";
$sql .= " LEFT JOIN " . EVENTS_LOCALE_REL_TABLE . " lr ON lr.venue_id = ev.id ";
$sql .= " LEFT JOIN " . EVENTS_LOCALE_TABLE . " el ON el.id = lr.locale_id ";
if( function_exists('espresso_member_data') && ( espresso_member_data('role')=='espresso_group_admin' ) ){
if( $espresso_manager['event_manager_venue'] == "Y" ){
//show only venues inside their assigned locales.
$group = get_user_meta(espresso_member_data('id'), "espresso_group", true);
$group = unserialize($group);
$sql .= " $WHERE lr.locale_id IN (" . implode(",", $group) . ")";
$sql .= " OR ev.wp_user = ".$current_user->ID ;
$WHERE = " AND ";
}
}
$sql .= " GROUP BY ev.id ORDER by name";
//echo $sql;
$venues = $wpdb->get_results($sql);
$num_rows = $wpdb->num_rows;
return “
".print_r( $venues,true )."
“;
/*
[id] => 3
[name] => Home
[identifier] =>
[address] => 101-1414 Government Street
[address2] =>
[city] => Penticton
[state] => BC
[zip] => V2A 4W1
[country] => Canada
[meta] => a:6:{s:7:”contact”;s:0:””;s:5:”phone”;s:0:””;s:7:”twitter”;s:0:””;s:5:”image”;s:0:””;s:7:”website”;s:0:””;s:11:”description”;s:0:””;}
[locale] =>
[wp_user] => 0
*/
//echo $current_value;
if ($num_rows > 0) {
$field = ” . (‘Select from Venue Manager list’, ‘event_espresso’) . ”;
$field .= ‘\n’;
$field .= ”.(‘Select a Venue’, ‘event_espresso’).”;
$div = “”;
$help_div = “”;
$i = 0;
foreach ($venues as $venue){
$i++;
$selected = $venue->id == $current_value ? 'selected="selected"' : '';
if ($venue->locale != '') {
$field .= 'id .'">' . stripslashes_deep($venue->name) . ' (' . stripslashes_deep($venue->locale) . ') \n';
} else if ($venue->city != '' && $venue->state != '') {
$field .= 'id .'">' . stripslashes_deep($venue->name) . ' (' . stripslashes_deep($venue->city). ', ' . stripslashes_deep($venue->state) . ') \n';
} else if ($venue->state != '') {
$field .= 'id .'">' . stripslashes_deep($venue->name) . ' (' . stripslashes_deep($venue->state) . ') \n';
} else {
$field .= 'id .'">' . stripslashes_deep($venue->name) . ' \n';
}
$hidden = "display:none;";
if( $selected ) $hidden = '';
$div .= "";
$div .= "Address: ".stripslashes_deep($venue->address)."";
$div .= "Address 2: ".stripslashes_deep($venue->address2)."";
$div .= "City: ".stripslashes_deep($venue->city)."";
$div .= "State: ".stripslashes_deep($venue->state)."";
$div .= "Zip: ".stripslashes_deep($venue->zip)."";
$div .= "Country: ".stripslashes_deep($venue->country)."";
$div .= "Venue ID: ".$venue->id."";
$div .= '<a>id.'" target="_blank">'.__('Edit this venue', 'event_espresso').'</a> | <a href="#TB_inline?height=300&width=400&inlineId=venue_info">Shortcode</a>';
$div .= "";
}
$field .= "";
$help_div .= '';
$help_div .= ''.__('Venue Shortcode', 'event_espresso').'';
$help_div .= ''.__('Add the following shortcode into the description to show the venue for this event.', 'event_espresso').'';
$help_div .= '[ESPRESSO_VENUE]';
$help_div .= ''.__('To use this venue in a page or post. Use the following shortcode.', 'event_espresso').'';
$help_div .= '[ESPRESSO_VENUE id="selected_venue_id"]';
$help_div .= 'Example with Optional Parameters:[ESPRESSO_VENUE outside_wrapper="div" outside_wrapper_class="event_venue"]';
$help_div .= '<strong><a href="https://eventespresso.com/forums/2010/10/post-type-variables-and-shortcodes/#venue_shortcode">More Examples</a></strong>';
$help_div .= '';
ob_start();
?>
jQuery("#venue_id").change( function(){
var selected = jQuery("#venue_id option:selected");
var rel = selected.attr("rel");
jQuery(".eebox").hide();
jQuery("#eebox_"+rel).show();
});
if ( !function_exists( ‘espresso_personnel_cb’ ) ){
function espresso_personnel_cb($event_id = 0){
global $espresso_premium; if ($espresso_premium != true) return;
global $wpdb;
$sql = “SELECT id, name, role, meta FROM ” . EVENTS_PERSONNEL_TABLE;
if (function_exists(‘espresso_member_data’) ) {
$wpdb->get_results(“SELECT wp_user FROM ” . EVENTS_DETAIL_TABLE . ” WHERE id = ‘” . $event_id . “‘”);
$wp_user = $wpdb->last_result[0]->wp_user !=” ? $wpdb->last_result[0]->wp_user:espresso_member_data(‘id’);
$sql .= ” WHERE “;
if ($wp_user == 0 || $wp_user == 1){
$sql .= ” (wp_user = ‘0’ OR wp_user = ‘1’) “;
}else{
$sql .= ” wp_user = ‘” . $wp_user .”‘ “;
}
}
$event_personnel = $wpdb->get_results($sql);
$num_rows = $wpdb->num_rows;
if ($num_rows > 0){
$html= ”;
foreach ($event_personnel as $person){
$person_id = $person->id;
$person_name = $person->name;
$person_role = $person->role;
$meta = unserialize($person->meta);
$person_organization = (isset($meta['organization']) && $meta['organization'] !='') ? $meta['organization'] :'';
//$person_title = $meta['title']!=''? $meta['title']:'';
$person_info = (isset($person_role) && $person_role !='') ?' ['. $person_role . ']':'';
$in_event_personnel = $wpdb->get_results("SELECT * FROM " . EVENTS_PERSONNEL_REL_TABLE . " WHERE event_id='".$event_id."' AND person_id='".$person_id."'");
$in_event_person = '';
foreach ($in_event_personnel as $in_person){
$in_event_person = $in_person->person_id;
}
$html .= ' <a href="admin.php?page=event_staff&action=edit&id='.$person_id.'" title="'.$person_organization.'">' . $person_name .'</a> '. $person_info.'';
}
$top_div ='';
$bottom_div ='';
if ($num_rows > 10){
$top_div = '';
$bottom_div = '';
}
$manage = '<a href="admin.php?page=event_staff">'.__('Manage Staff Members', 'event_espresso').'</a> | <a href="#TB_inline?height=300&width=400&inlineId=staff_info">Shortcode</a> ';
echo '';
echo ''.__('Staff Shortcode', 'event_espresso').'';
echo ''.__('Add the following shortcode into the description to show the staff for this event.', 'event_espresso').'';
echo '[ESPRESSO_STAFF]';
echo 'Example with Optional Parameters:
[ESPRESSO_STAFF outside_wrapper="div" outside_wrapper_class="event_staff" inside_wrapper="p" inside_wrapper_class="event_person"]';
echo '<strong><a href="https://eventespresso.com/forums/2010/10/post-type-variables-and-shortcodes/#staff_shortcode">More Examples</a></strong>';
echo '';
$html = $top_div.$html.$bottom_div.$manage;
return $html;
}else{
return '<a href="admin.php?page=event_staff&action=add_new_person">'.__('Please add at least one person.', 'event_espresso').'</a>';
}
}
}
if ( !function_exists( ‘espresso_personnel_dd’ ) ){
function espresso_personnel_dd(){
global $espresso_premium; if ($espresso_premium != true) return;
global $wpdb;
$sql = “SELECT name, title FROM EVENTS_PERSONNEL_TABLE “;//. EVENTS_DETAIL_TABLE;
$sql .= ” WHERE name != ” GROUP BY name “;
}
if (!function_exists(‘espresso_chart_display’)){
function espresso_chart_display($event_id, $type){
global $wpdb, $org_options;
$retVAl = array();
switch ($type){
case ‘total_reg’:
//Total Registrations/Transactions
$title = __(‘Total Registrations/Transactions’, ‘event_espresso’);
$sql = “SELECT SUM(a.amount_pd) amount, SUM(a.quantity) quantity, DATE_FORMAT(a.date,’%b %d’) date FROM “.EVENTS_ATTENDEE_TABLE.” a WHERE event_id =”.$event_id.” GROUP BY DATE_FORMAT(a.date,’%m-%d-%Y’)”;
break;
case 'total_completed':
//Completed Registrations/Transactions
$title = __('Completed Registrations/Transactions', 'event_espresso');
$sql = "SELECT SUM(a.amount_pd) amount, SUM(a.quantity) quantity, DATE_FORMAT(a.date,'%b %d') date FROM ".EVENTS_ATTENDEE_TABLE." a WHERE event_id =".$event_id." AND payment_status='Completed' GROUP BY DATE_FORMAT(a.date,'%m-%d-%Y')";
break;
case 'total_pending':
//Pending Registrations/Transactions
$title = __('Pending Registrations/Transactions', 'event_espresso');
$sql = "SELECT SUM(a.amount_pd) amount, SUM(a.quantity) quantity, DATE_FORMAT(a.date,'%b %d') date FROM ".EVENTS_ATTENDEE_TABLE." a WHERE event_id =".$event_id." AND payment_status='Pending' GROUP BY DATE_FORMAT(a.date,'%m-%d-%Y')";
break;
case 'total_incomplete':
//Incomplete Registrations/Transactions
$title = __('Incomplete Registrations/Transactions', 'event_espresso');
$sql = "SELECT SUM(a.amount_pd) amount, SUM(a.quantity) quantity, DATE_FORMAT(a.date,'%b %d') date FROM ".EVENTS_ATTENDEE_TABLE." a WHERE event_id =".$event_id." AND (payment_status='Incomplete' OR payment_status='Payment Declined') GROUP BY DATE_FORMAT(a.date,'%m-%d-%Y')";
break;
}
$results = $wpdb->get_results($sql);
if ($wpdb->num_rows > 0) {
foreach ($results as $row) {
$retVal[] = $row;
}
$attendees = '';
$amount ='';
$date = '';
foreach($retVal as $rec ){
$amount .= $rec->amount.',';
$date .= "'".$rec->date."', ";
$attendees .= $rec->quantity.", ";
}
//echo "<pre>".print_r($retVal,true)."</pre>";
?>
jQuery(document).ready(function() {
var line1 = [];//bottom column
var line2 = [];
var ticks = [];
plot1 = jQuery.jqplot('', [line1, line2], {
//stackSeries: true,
title: '',
seriesDefaults:{
renderer:jQuery.jqplot.BarRenderer,
pointLabels: { show: true },
},
axes: {
xaxis: {
renderer: jQuery.jqplot.CategoryAxisRenderer,
ticks: ticks
}
},
series: [{
label: '# Attendees'
},
{
label: ' ',
pointLabels: { formatString:'%.2f' },
}],
legend: {
show: true,
location: 'ne', // compass direction, nw, n, ne, e, se, s, sw, w.
placement: 'outsideGrid'
},
});
});
<!-- -->
<div id="" style="margin-top:20px; margin-left:20px; width:600px; height:200px; float:left;">
"","event_format"=>"","event_livestreamed"=>"");
}
}
if (!function_exists(‘event_espresso_meta_edit’)){
function event_espresso_meta_edit($event_meta=”) {
global $wpdb, $org_options;
global $espresso_premium;
if ($espresso_premium != true)
return;
$good_meta = array();
$hiddenmeta = array(“”, “venue_id”, “additional_attendee_reg_info”, “add_attendee_question_groups”, “date_submitted”, “event_host_terms”, “default_payment_status”,”event_thumbnail_url”);
$meta_counter = 1;
//Build the email
function espresso_prepare_email_data($attendee_id, $multi_reg, $custom_data=”) {
global $wpdb, $org_options;
do_action(‘action_hook_espresso_log’, FILE, FUNCTION, ”);
$data = new stdClass;
$data->multi_reg = $multi_reg;
$data->seatingchart_tag = ”;
//print_r($custom_data);
//Create vars for the custom data
if (!empty($custom_data)) {
extract($custom_data, EXTR_PREFIX_ALL, ‘custom_data’);
}
//End espresso_prepare_email_data()
//Get the email ready to send
function espresso_prepare_email($data) {
global $org_options;
do_action(‘action_hook_espresso_log’, FILE, FUNCTION, ”);
//Build the subject line
$email_subject = $data->email_subject;
//Merge all the data
if ($data->event->email_id > 0 && $data->event->send_mail == 'Y' ) { //Get the email template if it exists
$email_data = array();
$email_data = espresso_email_message($data->event->email_id);
$conf_mail = $email_data['email_text'];
$email_subject = $email_data['email_subject'];
} elseif ($data->event->conf_mail != '' && $data->event->send_mail == 'Y') {//Else get the custom event email
$conf_mail = $data->event->conf_mail;
} else {//Else get the default email from the general settings
$conf_mail = $org_options['message'];
}
//Get the email subject
$email_subject = replace_shortcodes($email_subject, $data);
//Replace email shortcodes
$_replaced = replace_shortcodes($conf_mail, $data);
//Build the HTML
$message_top = "";
$message_bottom = "";
$email_body = $message_top . $_replaced . $message_bottom;
if (!isset($headers))
$headers = '';
return array(
'send_to' => $data->attendee->email,
'email_subject' => $email_subject,
'email_body' => $email_body,
'headers' => $headers
);
}
//End espresso_prepare_email()
//Build the admin email
function espresso_prepare_admin_email($data) {
global $org_options;
do_action(‘action_hook_espresso_log’, FILE, FUNCTION, ”);
//Edit attendee link
$admin_attendee_link = espresso_edit_attendee($data->attendee->registration_id, $data->attendee->id, $data->attendee->event_id, ‘admin’, $data->attendee->fname . ‘ ‘ . $data->attendee->lname);
Okay, that was more information than I needed and doesn’t really help me all that much. Can you just post the actual function that you added your code to and indicate where you added your code specifically? It’s possible that this might work better as a Gist or on Piratepad.
The support post ‘Display Price in Confirmation Admin Email’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.