User Tools

Site Tools


software:eventsmanager

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
software:eventsmanager [2013/06/16 18:42] – created superwizardsoftware:eventsmanager [2013/06/16 18:52] (current) superwizard
Line 1: Line 1:
 +====== Export Transactions ======
  
- +From: http://eventsmanagerpro.com/support/questions/printcsv-printexport-the-transaction-no-and-transaction-date/
-From: +
  
     $results = $wpdb->get_results("SELECT * FROM ".EM_TRANSACTIONS_TABLE." WHERE booking_id='".$EM_Booking->booking_id."'", ARRAY_A);     $results = $wpdb->get_results("SELECT * FROM ".EM_TRANSACTIONS_TABLE." WHERE booking_id='".$EM_Booking->booking_id."'", ARRAY_A);
Line 7: Line 7:
       echo $results['transaction_id']; //this is the transaction id for example       echo $results['transaction_id']; //this is the transaction id for example
     }     }
 +    
 +    
 +From: http://eventsmanagerpro.com/support/tickets/export-total-transaction-amount/    
 +
 +total transaction amount by adding a new exportable column.
 +
 +    /**
 +    * Adds columns in the bookings tables
 +    * @param array $template
 +    * @param EM_Bookings_Table $EM_Bookings_Table
 +    * @return string
 +    */
 +    function my_em_bookings_table_cols_template($template, $EM_Bookings_Table){
 +     $template['transaction_price'] = 'TXN Price';
 +        return $template;
 +    }
 +    add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template',10,1);
 +
 +    /**
 +    * @param string $val
 +    * @param string $col
 +    * @param EM_Booking $EM_Booking
 +    */
 +    function my_em_custom_booking_form_cols_txn_price($val, $EM_Booking){
 +            global $wpdb;
 +     $var = $wpdb->get_var('SELECT transaction_total_amount FROM '.EM_TRANSACTIONS_TABLE.' WHERE booking_id='.$EM_Booking->booking_id);
 +        return em_get_currency_formatted($var);
 +    }
 +    add_filter('em_bookings_table_rows_col_transaction_price','my_em_custom_booking_form_cols_txn_price', 10, 3);
software/eventsmanager.1371408154.txt.gz · Last modified: 2013/06/16 18:42 by superwizard