Posted: July 12, 2021 at 10:02 am
Is there a way to add a service fee to only someone from a certain state. We need to add a 1% service charge to only CT registrations. I see a way to add a service fee to all but is there a way to narrow down to just CT? We use PayPal pro to collect payments. |
|
Hi there, We don’t have an option for this built into Event Espresso directly but it can be done via a hook and some custom code. The closest example we currently have would be this: https://gist.github.com/joshfeck/bc4ffb1d4417258fce3ce32e00d25ea8 That’s hooking into the Address state field on the registration form and applying specific surcharges based on the selected value. Do you have a test event I can look at n the site? I can give you a more accurate example once I’ve seen your set up if needed. |
|
i just created this test event. what other information do you need? https://www.accordantco.com/content/events/accounts-payable-14/ |
|
No other info is needed for this, however, the above won’t work with your current setup as you don’t collect the address info questions on the registration form. For this to work you’ll need to set the event(s) to collect address information on the registration form so that EE can add the service change in before the payment options load (the payment options form is too late to add the additional value onto the request). Can you set the above event to require the address information question group? |
|
ok, can you try now? also, one question. if we have to add custom code, does this have to be done per event or is this something that is coded globally? if it is done per event, will it carry over when you use the duplicate event feature? |
|
Ok, add this snippet to your site: https://gist.github.com/Pebblo/604d24c5e22a4f2652a9962df123d958 You can add that to a custom functions plugin on your site, we have some documentation on creating one here: https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/ I’m not based in the US so just to double-check, CT is Connecticut, right?
This applies to all events, well, technically all registrations where they select Connecticut. It can be altered to only apply to specific events if that’s what you need?
As long at the ‘Address information’ question group is set and the user sets the correct state, this service charge will be applied. |
|
another question. can the information entered into the registration section be carried over to the billing section so the person registering does not have to enter the information twice? |
|
Hmm, that should happen automatically anyway. Can you add a paid ticket to that event so I can take a look? |
|
I added a paid fee and tested. the information does carry over. |
|
Great, so in that case, you should be able to just add the above snippet and the service fee will apply. |
|
The support post ‘Service Fee’ 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.