Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stonehenge_em_add_surcharge( $EM_Event, $EM_Booking, $post_validation ) {
- if( $post_validation ) {
- if( empty($EM_Booking->booking_meta['surcharges']) ) $EM_Booking->booking_meta['surcharges'] = array();
- $spaces = $EM_Booking->spaces;
- $netto = '5.00';
- $tax_rate = $EM_Booking->booking_tax_rate;
- $tax_perc = ($tax_rate/100);
- $bruto = ($netto / (1 + $tax_perc));
- $total = number_format( ($bruto * $spaces), 4);
- $EM_Booking->booking_meta['surcharges'][] = array(
- 'name' => sprintf('Vollkasko für %d Personen', $spaces),
- 'desc' => '',
- 'type' => '#',
- 'amount' => $total,
- 'tax' => 'pre'
- );
- }
- }
- add_action('em_booking_add', 'stonehenge_em_add_surcharge', 11, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement