Support

Home Forums Event Espresso Premium Barcodes and printable tickets

Barcodes and printable tickets

Posted: June 8, 2016 at 9:19 am


cv

June 8, 2016 at 9:19 am

Hi Guys

EE4 4.8.43.p
I have installed plugins and essentially I think its working. I am able to receive an email with the link ‘Print tickets’ when I make a registration. All seems fine.

Questions:

1. Am I able to insert the [TXN_TICKETS_URL] into another message template (I tried and it said no)?

2. Am I able to include the ticket directly in the email?

3. The resend ticket button from the ‘my registrations’ doesn’t work either (just takes you to the event details. I have checked that it looks like this http://cl.ly/1T313c060U3I

The link looks like this: /events/my-event/?token=1-5e49f3210c27a885565926a09a39ce67&resend=1

Thanks
M


Tony

  • Support Staff

June 8, 2016 at 11:03 am

Hi M,

1. Am I able to insert the [TXN_TICKETS_URL] into another message template (I tried and it said no)?

Which message type did you try to add it to and where?

2. Am I able to include the ticket directly in the email?

No, only the URL to the ticket can be included within the emails.

3. The resend ticket button from the ‘my registrations’ doesn’t work either (just takes you to the event details. I have checked that it looks like this http://cl.ly/1T313c060U3I

Can you post a screenshot of the link you are using please?


cv

June 8, 2016 at 3:16 pm

Hi

1. I’ve successfully managed to get the URL into the reg approved email – thats perfect.
3. This is the link which opens (no js execution or anything fancy)
http://postimg.org/image/lqs66kxxn/

Regards
M


Tony

  • Support Staff

June 8, 2016 at 3:29 pm

3. This is the link which opens (no js execution or anything fancy)
http://postimg.org/image/lqs66kxxn/
Regards

Yes but how and where are you loading that link?

Using [ESPRESSO_MY_EVENTS]?

/events/my-event/?token=1-5e49f3210c27a885565926a09a39ce67&resend=1

Have you add that shortcode within the event description?

/events/my-event/ would be the default slug for an EE event called ‘My Event’ so I just want to clarify how your loading this.


cv

June 8, 2016 at 4:52 pm

Hi

We are using this code within the php of a custom page template:
<?php echo do_shortcode("[ESPRESSO_MY_EVENTS template='simple_list_table']");?>

We are also loading the ees-espresso-my-events.js & ees-espresso-my-events.css manually in functions.

Regards
M


Tony

  • Support Staff

June 9, 2016 at 3:35 am

Can you link me to the page I can view this on please?

If I need login details you can send temporary login details using this form:

https://eventespresso.com/send-login-details/


cv

June 9, 2016 at 3:53 am

Sent as requested.

M


Tony

  • Support Staff

June 9, 2016 at 4:58 am

Ok, so the link in use on that table is incorrect and is what is causing the problem.

The link should use the url of the page you are currently viewing but your template is outputting the url of the actual event.

The link should be:

/userdetails/?token=1-5e49f3210c27a885565926a09a39ce67&resend=1

Not:

/events/my-event/?token=1-5e49f3210c27a885565926a09a39ce67&resend=1

Your using a custom version of the template, so if you rename your custom template (add something to the filename) and load the original version of the template, does the link work correctly?


cv

June 9, 2016 at 5:53 am

Hi Tony

Some progress…

We haven’t changed the templates and the original ones are being used. We are just using CSS to hide a couple of the buttons but nothing else.

As far as I can see this is being used starting line 40 in content-espresso_my_events-simple_list_table.template.php

$resend_registration_link = add_query_arg(
	array( 'token' => $registration->reg_url_link(), 'resend' => true ),
	get_permalink( EE_Registry::instance()->REQ->get_post_id_from_request() )
		);

This is adversely affecting the links because I am using a getposts in the page to fetch the event, so the wrong link is ‘left over’ from the last post and scooped up by the shortcode. I have worked around this by executing the shortcode prior to the getposts.

You can now see that the links are correct, but clicking on the resend causes an error in the header (however I do receive the email – yay).

I’m not sure what is still missing from the puzzle.

Regards
M


Tony

  • Support Staff

June 9, 2016 at 6:18 am

You should just be able to run wp_reset_postdata(); after your get_posts() loop.

You can now see that the links are correct, but clicking on the resend causes an error in the header (however I do receive the email – yay).
I’m not sure what is still missing from the puzzle.

Are you logging the errors?

If not use something like:

define( 'WP_DEBUG', true ); // Or false
if ( WP_DEBUG ) {
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );
}

To log all errors within a debug.log file, it would be another error being thrown before the headers.


cv

June 10, 2016 at 9:55 am

Hi Tony

Just to round this off. We spent some time looking into this but it wasn’t worth the pain. What we can confirm is that using the shortcode in php is very different to using it in a post.

In the post> additional html divs are inserted, css and js is enqueued and possibly other php is included (we didn’t dig that deep). All of this means the shortcode buttons will not work correctly when the shortcode is not loaded via a post.

I’m not sure its a bug – but a shortcoming for sure. In my experience of shortcodes is they work the same in a post as in php but that might be my limited experience.

I appreciate your help.
M


Josh

  • Support Staff

June 16, 2016 at 8:48 am

The problem you’ll see with using a short code like [ESPRESSO_MY_EVENTS] in a PHP template (instead of the post content) is the required assets (like CSS and JavaScript files) would need to load on every page on the front end in order to make sure they load. There’s a mechanism in place to only load scripts and styles where they’re needed. If you want to load the assets via a template, you can enqueue them in your template code.


cv

June 16, 2016 at 11:39 am

Hi Josh

We did indeed enqueue all the css and js manually, but these are not the whole story. Adding these do not create *all* of the parts needed for the shortcode to work fully.

M


Josh

  • Support Staff

June 20, 2016 at 8:35 am

It’s also a potential gotcha to run a short code that runs its own loop outside the normal WP loop. This is because the shortcode is designed to run from within the WordPress Loop’s content section.

The support post ‘Barcodes and printable tickets’ 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