How to show total price before check out
-
Hello Patrick,
as per this thread https://eventsmanagerpro.com/support/questions/how-to-add-a-fixed-booking-fee-to-all-events/
We plan to charge a booking fee of 0.99 euro to any ticket before 21% vat tax.
We have implemented the following snippet on our function.php file//Add 0.99 euro booking fee
function booking_fee( $EM_Event, $EM_Booking, $post_validation ){
//Only apply surcharge if booking has passed validation and therefore can be saved to database
//You could also do further checks here if you want to give discounts to specific events or bookings
if( $post_validation ){
//Ensure we have arrays assigned to booking meta, if not create them to avoid PHP warningsif( empty($EM_Booking->booking_meta[‘discounts’]) ) $EM_Booking->booking_meta[‘discounts’] = array();
//Example Surcharges
//This one adds a fixed 0.99 surcharge and is applied before taxes
$EM_Booking->booking_meta[‘surcharges’][] = array(
‘name’ => ‘Service kosten’,
‘desc’ => ‘Service kosten’,
‘type’ => ‘#’,
‘amount’ => ‘0.99’,
‘tax’ => ‘pre’
);}
}
add_action(’em_booking_add’, ‘booking_fee’, 10, 3);This code is working but it only adds the booking fee to the ticket price at the check out page (see: https://eventsmanagerpro.com/support/wp-content/uploads/2019/07/price-at-gateway.jpg) but not on the event page (see: https://eventsmanagerpro.com/support/wp-content/uploads/2019/07/price-before-gateway.jpg)
We need to show the total price right away to our customer, could you please help us? Thanks!
The page I need help with: [log in to see the link]
- The topic ‘How to show total price before check out’ is closed to new replies.