Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- This function will add the date of the event to the ticket name on PayPal
- Please note that this may cause problems for longer ticket names.
- For installation instructions - http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
- */
- function my_em_paypal_vars_ticketdescs($paypal_vars, $EM_Booking){
- $count = 1;
- $date_format = ( get_option('dbem_date_format') ) ? get_option('dbem_date_format'):get_option('date_format');
- foreach( $EM_Booking->get_tickets_bookings()->tickets_bookings as $EM_Ticket_Booking ){
- $paypal_vars['item_name_'.$count] = wp_kses_data($EM_Ticket_Booking->get_ticket()->ticket_name .' - '.$EM_Ticket_Booking->get_booking()->get_event()->event_name.' - '.date_i18n($date_format, $EM_Ticket_Booking->get_booking()->get_event()->start));
- $count++;
- }
- return $paypal_vars;
- }
- add_filter('em_gateway_paypal_get_paypal_vars', 'my_em_paypal_vars_ticketdescs',10,2);
Add Comment
Please, Sign In to add comment