Support

Home Forums Event Espresso Premium Print button on ticket page

Print button on ticket page

Posted: March 17, 2022 at 3:41 pm


CapellaAmersfoort

March 17, 2022 at 3:41 pm

Hi,

My mother in law wants to visit a concert and buyed a ticket on our side.
She got the ticket link in her mail, but do not know how to print the ticket.
Good question! I know you can do it by Ctrl + p, but not everybody is familiar of this functionality.
My question: is it possible to add a ‘print’ or download button on my ticket page?


CapellaAmersfoort

March 18, 2022 at 3:33 am

I tried to add the following to my ticket, but after saving only the button is available with the function onclick=”windows.print()”

<div><button onClick="window.print()">Print this page
</button></div>


CapellaAmersfoort

March 18, 2022 at 4:32 am

Same with:
<a title="Print Tickets" alt="Print Tickets" onclick="window.print();" target="_blank" style="cursor:pointer;">Click HERE to print your tickets</a>

I add this to my ticket, but “onclick=”window.print();” disappearce after saving


Tony

  • Support Staff

March 18, 2022 at 11:16 am

Hi there,

The fields in the message templates are now sanitized differently to when the above suggestions of using inline JS were made.

I’ve put together a snippet that will add a [PRINT_BUTTON_*] shortcode to the message system here:

https://gist.github.com/Pebblo/8b5eaeb9c16d89073d64e1b7c8f78e00

You can set ‘title’, ‘alt’ and ‘text’ parameters on the shortcode:

[PRINT_BUTTON_* title='Print Tickets' text='Click HERE to print your tickets']

With the above snippet/shortcode will output the same as what you have in the last example.

You can add that snippet 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/


CapellaAmersfoort

March 20, 2022 at 8:49 am

Thx! Also my mother in law is happy now πŸ˜€


CapellaAmersfoort

March 20, 2022 at 8:51 am

Hope a ticket as pdf attachment in the mail is on the road map!


Tony

  • Support Staff

March 21, 2022 at 5:18 am

Thx! Also my mother in law is happy now πŸ˜€

Awesome πŸ™‚

Hope a ticket as pdf attachment in the mail is on the road map!

We have discussed this previously and right now, it is not for a couple of reasons.

We already run into issues with people’s emails when purchasing ticket, adding attachments complicates that more and could mean more email issues (which we don’t want).

The ticket uses a QR/Barcode which is generated using a JS library within the browser, to be able to attach an PDF to an email we would need to switch out to use a different server based library to both generate the PDF and the QR’s. That’s all well and good and some are available, but as we are a distributed product that also comes with limitations on making sure the server has the correct modules installs etc.

In short, it sounds like a nice easy feature to implement until you get to all the technicalities behind it and then realise that if it doesn’t work for 99% of users straight out of the box (based on server setup) it just adds more confusion and frustration for everyone.

Anyway, just thought I’d give a quick glimpse of the bigger picture for this. I’m not saying we wont add a feature like this in the future but I can tell you it’s not due out any time soon πŸ™‚

The support post ‘Print button on ticket page’ 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