Support » Plugin: Events Manager Pro - Mollie Payments » How to show total price before check out

  • Resolved mbri

    (@mbri)


    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 warnings

    if( 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]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    The total price is NEVER shown on a single event page. No discounts, nor surcharges. Prices after coupon use are also never shown.

    The reason for that is very simple. All of those kinds of calculations are done in the back-end (naturally) and the single event form does not “go back” to the backend.

    Showing the (sub)total price is not part of any payment gateway, as this is shown before any gateway has been called.

    If you want to show a price overview, that is called a cart and is part of EM’s Multiple Bookings Mode.

    I did however create a snippet myself to show a ‘sort of’ subtotal on the single event booking form. It technically can not calculate coupon discounts, but since you are using a set fee, all you really need is a way to simply show it to the customer.
    So you could use this snippet as a starter. It works great with single tickets, but not sure of I adapted it to multiple ticket types per event.

    Here’s the tutorial:
    https://www.stonehengecreations.nl/show-sub-total-in-events-manager/

    To see the snippet in live action, checkout any of my events on http://www.gidspatrick.nl

    mbri

    (@mbri)

    Hi Patrick thanks a lot, I saw your tour site, nice idea! Do you know about Airbnb experiences? https://www.airbnb.nl/s/experiences I believe that you could get some traffic from there. To be honest I thought to do the same for italians and spanish, since i speak both languages and I live 10 years in The hague now :).

    About the script, I have not been able to see the tutorial, i believe you are doing some maintenance, I will chack in a while and let you know how it worked for us. I have seen it in your site and is looking good.

    Cheers!

    Hi Patrick thanks for the snippets it works great. I have done minimal customization to add the booking field on the 2 calculations and show some extra info about it to the customers. You can see the result here https://groftalent.nl/events/hip-hop-dance-rappen-2019-08-17/
    Hartelijk bedankt voor je hulp.
    Ik zal graag met je willen afspreken, we zouden jou graag in onze team willen hebben tegen betaling. Zou je deze week tijd hebben? of eerste week van september misschien?
    Cheers

    Plugin Author Stonehenge Creations

    (@duisterdenhaag)

    *Vreugdedansje maak*
    Email me even op info Stonehenge Creations in ons mooie land. (sorry, maar anders rolt de spam binnen) LOL.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to show total price before check out’ is closed to new replies.