eventsmanager

Show WC Amount Paid

Feb 9th, 2022 (edited)
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. /*
  2. * Goto to Events > Bookings > Click on the Gear Icon > Choose 'WC Total Payment'
  3. */
  4. function my_em_bookings_table_cols_template_wc_total($template, $EM_Bookings_Table){
  5. $template['total_paid'] = 'WC Total Payment';
  6. return $template;
  7. }
  8. add_action('em_bookings_table_cols_template', 'my_em_bookings_table_cols_template_wc_total',10,2);
  9.  
  10. function my_em_custom_booking_form_cols_wc_total($val, $col, $EM_Booking, $EM_Bookings_Table, $csv){
  11.  
  12. if( $col == 'total_paid' ){
  13. $val = get_post_meta($EM_Booking->booking_meta['woocommerce']['order_id'],'_order_total',true);
  14. }
  15.  
  16. return $val;
  17. }
  18. add_filter('em_bookings_table_rows_col','my_em_custom_booking_form_cols_wc_total', 10, 5);
Add Comment
Please, Sign In to add comment