Support

Home Forums Event Espresso Premium How to add the convenience fee to the reports

How to add the convenience fee to the reports

Posted: September 8, 2014 at 5:47 pm


Michael Mansell

September 8, 2014 at 5:47 pm

Is there a way I can add the Convenience fee field to the reports. I need this for daily reporting and it currently isn’t on the report. The total is all lumped into one field.


Michael Mansell

September 8, 2014 at 5:47 pm

I must have the convenience fee broken out on the report. It is already very frustrating that you don’t have a separate tax field for sales but why is there no field in the exported data for this fee? I could use it for the tax but not if there is no data in the exported report.

How can I resolve this?


Michael Mansell

September 9, 2014 at 6:22 pm

Can I get some help on this please?


Josh

  • Support Staff

September 10, 2014 at 10:21 am

Hi Michael,

I looked into this and I can advise that in order to make this happen, it may require some significant PHP development by a PHP developer. There are also a number of factors depending on how you’re using EE’s surcharge feature.

While we generally do not provide a detailed level of customization support via the forums, I can point you to the where the code can be changed and how to preserve the code from getting overwritten on an update. If you have some experience with PHP programming this should be something you can do, or you can contract with a PHP developer and the following information will help them get started:

The functions that handle the export feature are in Event Espresso 3 are in includes/functions/export.php. The functions within this file are wrapped in

`if (!function_exists()) {}` checks, which allows them to be copied over to /wp-content/uploads/espresso/custom_functions.php and EE will check there first. This allows your custom functions to run from a place that won’t get overwritten on an update.

Within the export.php file there are a number of queries to get the registration information. The table that stores information on pricing isn’t queried. The price column information that gets output in the report is queried from the events_attendee table, with a JOIN on the events_detail table. The price is calculated on the fly based on which price option is selected, so the surcharge amount isn’t a separate line item within the events_attendee table.

If your surcharge is the same across all events, that will simplify the calculation and not require an added query on the events_prices table.

So for example, if your convenience fee is a flat $5.00 per ticket, the code to display the base price of the ticket * number of tickets would be:

. $s . escape_csv_val(($participant->a_final_price - 5.00 ) * $participant->a_quantity)

The fee column code:

. $s . escape_csv_val(5.00 * $participant->a_quantity)

Alternatively, if the fee is percentage based (in this example we’ll have a 10% fee), and this is set the same for all events and tickets, they’d look like this:

// base price ticket without fee
. $s . escape_csv_val(round(($participant->a_final_price * .909090909 ) * $participant->a_quantity), 2)
// 10% fee broken out
. $s . escape_csv_val(round(($participant->a_final_price * .090909091 ) * $participant->a_quantity), 2)

The above code changes would be applied to the espresso_export_stuff function. Again, this function can be copied over in whole to /wp-content/uploads/espresso/custom_functions.php and it will run from there instead of from the core plugin.

If the fees vary from one event to another, then additional queries to the events_prices table will need to be written to grab the amount from the surcharge column.

The support post ‘How to add the convenience fee to the reports’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso