Posted: August 11, 2014 at 3:46 am
|
Hi Support The company is about to become VAT registered and therefore we now need to display VAT for all events as well as detailing on the email and PDF invoices. I found i can add the VAT easily as a default surcharge which i’ve also renamed to VAT via the General settings page. My questions are: 1. How can i display the VAT breakdown and the VAT total cost on the confirm event registration page? 2. How can i display the VAT breakdown and the VAT total cost on the email template? 3. How can i display the VAT breakdown and the VAT total cost on the PDF invoice? We are currently running Event Espresso – 3.1.36.4.P Many thanks |
|
Hi Support Please can i get an update on this ticket. Thanks |
Hi Michael, With EE3 to display VAT in each of those locations would require modifications to each of the sections mentioned.
This would require modification to the template used for this page – event-espresso/templates/confirmation_display.php
This would require modifications to both the Emails and a custom email shortcode to display the surcharge amount within the email.
By default the PDF Invoice template does not display a full VAT breakdown but can be modified to do so. We have a gist available that provides a function to display GST/VAT within the invoice on EE3. EE4 handles VAT much better is included within the Invoices by default, have you considered updating to EE4 previously? |
|
|
Hi Support Thanks for your responses, they are helpful but I do have a few more questions…
Is there an existing variable i can use within the ‘confirmation_display.php’ template to display the ticket price before the surcharge is applied as well as the actual surcharge amount?
Is there any documentation that would help me create the custom email shortcode to display the ticket price before the surcharge is applied as well as the actual surcharge amount?
I’ve got this to work perfectly with the gist (https://gist.github.com/joshfeck/52ac749150322a2e4221). Many thanks |
|
Hi Support I’ve managed to partially solve some of my questions 🙂 The first question, about displaying the surcharge breakdown on the confirm event registration page, is in part solved by using a custom shortcode defined in a previous ticket (https://eventespresso.com/topic/event-list-show-price-before-surcharge/). This shortcode displays the price without the surcharge perfectly but is it possible to provide another example that will show the actual surcharge amount? The second question i still can’t figure out. How can i include these shortcodes within an email? |
|
Hi, The emails don’t have shortcodes, but instead they have tags (confusingly thy both use square brackets). As Tony mentioned, the only way to achieve this would be to modify the email.php (/wp-content/plugins/event-espresso_31365/includes/functions/email.php) which contains these tags. This is a core file and we don’t recommend nor support modifications like that. The function is question is not pluggable nor does it have any action or filter hooks that can be used. As such changes to the file would be over written on plugin update. |
|
Hi Dean / Tony Please could you supply the code modification required to email.php? As a previous example, the code supplied in this request (https://eventespresso.com/topic/event-list-show-price-before-surcharge/) was incredibly useful! Many thanks |
|
Hi Michael, Well, if you have the shortcode ready to display the charge, then in the email.php you would need to add another tag to the $SearchValues array (example http://take.ms/w7cGn) and then add the shortcode to the $ReplaceValues array (example http://take.ms/emZRJ). What should happen is when the tag is parsed, the do_shortcode processes the shortcode and displays the output. As always, test on a development server first. |
|
Hi Dean Thanks for your reply… I’ve added the new tag to the $SearchValues array and then the shortcode to the $ReplaceValues array. The tag is showing in the email but it’s not pulling through the value calculated in my custom_shortcodes.php The function i have in custom_shortcodes.php is:
This function works fine on confirmation_display.php Is there something i’ve missed? Many thanks |
The function itself doesn’t, but you’ll basically need to replicate it into an email shortcode. This can be tricky in 3.1.36.5 because the email shortcodes are all contained in a core function. I can recommend downloading a copy of the Event Espresso 3.1.37 pre-release and working off of it. You can download this from your account page *after* you click the box to opt in to the pre-release channel. One of the nice additions to Event Espresso 3.1.37 is the function that handles the email shortcodes is pluggable, so you can override it with your own function elsewhere. One place Event Espresso will check first for functions is /wp-content/uploads/espresso/custom_functions.php. |
|
The support post ‘Displaying surcharge on email template and PDF invoice’ 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.