This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// substitute for lines 25-30 in my_events_page.php | |
while(list($key,$value)=each($_POST['checkbox'])): | |
$data = espresso_prepare_email_data($key, FALSE); | |
event_espresso_send_email(array( | |
'send_to' => $data->event->alt_email == '' ? $org_options['contact_email'] : $data->event->alt_email . ',' . $org_options['contact_email'], | |
'email_subject' => $data->event->event_name . ' ' . __('registration cancellation', 'event_espresso'), | |
'email_body' => $data->attendee->email . " | " . $data->attendee->lname . ", " . $data->attendee->fname . "<br>" | |
. "has cancelled for event:<br>" | |
. stripslashes_deep($data->event->event_name) . " | " . $data->attendee->price_option . "<br>" | |
. event_date_display($data->attendee->start_date) . ' - ' . event_date_display($data->attendee->end_date) . "<br>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// replaces line 24 of gateways/paypal/paypal_ipn.php | |
if (empty($_POST['ipn_track_id']) && ($_POST['payment_status'] == 'Completed' || $_POST['payment_status'] == 'Pending')) { | |
$payment_data['txn_details'] = serialize($_POST); | |
$payment_data['txn_id'] = $_POST['txn_id']; | |
$payment_data['payment_status'] = 'Pending'; | |
} elseif ($myPaypal->validateIpn()) { | |
// replaces line 12 on gateways/paypal/init.php, to add the second line in | |
add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_paypal'); | |
add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_paypal'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function event_espresso_send_payment_notification($atts) { | |
do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, ''); | |
global $org_options; | |
extract($atts); | |
if ($org_options['default_mail'] == 'Y') { | |
event_espresso_email_confirmations(array('attendee_id' => $attendee_id, 'send_admin_email' => 'false', 'send_attendee_email' => 'true', 'custom_data' => array('email_type' => 'payment', 'payment_subject' => $org_options['payment_subject'], 'payment_message' => $org_options['payment_message']))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_payment_link_display_function() { | |
echo '<a href="https://square.com"><img src="http://square_logo.gif"></a>'; | |
} | |
add_action('action_hook_espresso_display_offsite_payment_gateway', 'my_payment_link_display_function'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function email_by_session_id_custom ($session_id, $send_attendee_email = TRUE, $send_admin_email = TRUE, $multi_reg = FALSE) { | |
global $wpdb; | |
$sql = "SELECT id FROM " . EVENTS_ATTENDEE_TABLE . " WHERE attendee_session = %s"; | |
$attendees = $wpdb->get_col( $wpdb->prepare( $sql, $session_id )); | |
$admin_email_params = array('email_body'=>''); | |
foreach ($attendees as $attendee_id) { | |
$data = espresso_prepare_email_data($attendee_id, $multi_reg); | |
if ($send_attendee_email == 'true') { | |
$attendee_email_params = espresso_prepare_email($data); | |
event_espresso_send_email($attendee_email_params); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is an update to the function in uploads/espresso/custom_shortcodes.php | |
*/ | |
function show_cat_event_date_max($atts) { | |
extract(shortcode_atts(array('max_days' => 'No Date Supplied', | |
'event_category_id' => __('No Category ID Supplied','event_espresso'), | |
'show_deleted' => false), $atts)); | |
$max_days = "{$max_days}"; | |
$event_category_id = "{$event_category_id}"; | |
$show_deleted = $show_deleted == "true" ? true : false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function apply_coupon_to_primary_attendee_only ($ext_att_data_source) { | |
global $wpdb; | |
$attendee = $wpdb->get_row('SELECT * FROM ' . EVENTS_ATTENDEE_TABLE . ' WHERE id=' . $ext_att_data_source['attendee_id'], ARRAY_A); | |
if ($attendee['is_primary'] != 1) { | |
$wpdb->update(EVENTS_ATTENDEE_TABLE, | |
array('final_price'=>$attendee['orig_price']), | |
array('id'=>$attendee['id']), | |
array('%f'), | |
array('%d')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function espresso_prepare_event_link_fixed ($payment_data) { | |
global $wpdb; | |
remove_filter('filter_hook_espresso_prepare_event_link', 'espresso_prepare_event_link'); | |
$sql = "SELECT ea.event_id, ed.event_name, ed.externalURL FROM " . EVENTS_ATTENDEE_TABLE . " ea"; | |
$sql .= " JOIN " . EVENTS_DETAIL_TABLE . " ed ON ed.id=ea.event_id"; | |
$sql .= " WHERE ea.attendee_session='" . $payment_data['attendee_session'] . "'"; | |
$events = $wpdb->get_results($sql, OBJECT_K); | |
$payment_data['event_link'] = ''; | |
foreach ($events as $event) { | |
if (empty($event->externalURL)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1); | |
function espresso_create_wp_user($attendee_data) { | |
if( username_exists( $attendee_data['email'] ) == NULL ) { | |
global $org_options; | |
// Generate the password and create the user | |
$password = wp_generate_password( 12, false ); | |
$user_id = wp_create_user( $attendee_data['email'], $password, $attendee_data['email'] ); | |
// Set the users details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function espresso_ticket_dd($current_value = 0){ | |
if ($current_value == 0) | |
$current_value = 2; // Change this to the id of the ticket that you would like to be the default ticket. | |
global $espresso_premium; if ($espresso_premium != true) return; | |
global $wpdb; | |
$sql = "SELECT id, ticket_name FROM " .EVENTS_TICKET_TEMPLATES; | |
$sql .= " WHERE ticket_name != '' ORDER BY ticket_name "; | |
//echo $sql; | |
$tickets = $wpdb->get_results($sql); | |
$num_rows = $wpdb->num_rows; |