[Plugin: Events Manager] Patch to add taxes to booking table
-
Here’s a patch that will add taxes as an option in the bookings table.
Index: em-bookings-table.php =================================================================== --- em-bookings-table.php (revision 249) +++ em-bookings-table.php (working copy) @@ -83,7 +83,8 @@ 'booking_status'=>__('Status','dbem'), 'booking_date'=>__('Booking Date','dbem'), 'booking_price'=>__('Total','dbem'), - 'booking_id'=>__('Booking ID','dbem') + 'booking_id'=>__('Booking ID','dbem'), + 'ticket_price_taxes'=>__('Taxes','dbem') ), $this); $this->cols_tickets_template = apply_filters('em_bookings_table_cols_tickets_template', array( 'ticket_name'=>__('Ticket Name','dbem'), @@ -546,6 +547,8 @@ $cols[] = $EM_Ticket->$col; }elseif( $col == 'ticket_price' && $this->show_tickets && !empty($EM_Ticket) ){ $cols[] = $EM_Ticket->get_price(true); + }elseif( $col == 'ticket_price_taxes' && !empty($EM_Ticket) ){ + $cols[] = $EM_Ticket->get_taxes(true); }elseif( $col == 'ticket_id' && $this->show_tickets && !empty($EM_Ticket) ){ $cols[] = $EM_Ticket->ticket_id; }else{ Index: em-ticket.php =================================================================== --- em-ticket.php (revision 249) +++ em-ticket.php (working copy) @@ -206,6 +206,21 @@ return $price; } + /** + * Gets the subtotal for this ticket + * @return float + */ + function get_taxes($format = false){ + $price = $this->ticket_price; + if( is_numeric(get_option('dbem_bookings_tax')) && get_option('dbem_bookings_tax') > 0 ){ + $taxes = round($price * (get_option('dbem_bookings_tax')/100),2); + } + if($format){ + return em_get_currency_formatted($taxes); + } + return $taxes; + } + /** * Get the total number of tickets (spaces) available, bearing in mind event-wide maxiumums and ticket priority settings. * @return int
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: Events Manager] Patch to add taxes to booking table’ is closed to new replies.