Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- This snippet will add new placeholder #_PAYMENTGATEWAYTRANSID
- to display the payment gateway transaction id.
- */
- add_filter('em_booking_output_placeholder','my_em_get_payment_type_id',1,3);
- function my_em_get_payment_type_id($replace, $EM_Booking, $result){
- global $wp_query, $wp_rewrite, $wpdb;;
- switch( $result ){
- case '#_PAYMENTGATEWAYTRANSID':
- $replace = '';
- $sql = $wpdb->prepare( "SELECT transaction_gateway_id FROM ".EM_TRANSACTIONS_TABLE." WHERE booking_id= '".$EM_Booking->booking_id."' ");
- $gateway = $wpdb->get_var($sql);
- $replace = $gateway;
- break;
- }
- return $replace;
- }
- /**
- This snippet will add new placeholder #_PAYMENTGATEWAY
- to determine what gateway is used when the event is booked.
- */
- add_filter('em_booking_output_placeholder','my_em_get_payment_type',1,3);
- function my_em_get_payment_type($replace, $EM_Booking, $result){
- global $wp_query, $wp_rewrite, $wpdb;;
- switch( $result ){
- case '#_PAYMENTGATEWAY':
- $replace = '';
- $sql = $wpdb->prepare( "SELECT transaction_gateway FROM ".EM_TRANSACTIONS_TABLE." WHERE booking_id= '".$EM_Booking->booking_id."' ");
- $gateway = $wpdb->get_var($sql);
- $replace = $gateway;
- break;
- }
- return $replace;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement