WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] generate pdf with ticket (13 posts)

  1. the0and1
    Member
    Posted 10 months ago #

    Is it possible to generate a pdf with the details of the event when a user signs up for an event?

    I know how to generate a pdf with php, but I can't seem to figure out how and where to hook this into the events manager plugin.

    Basically I want to generate a pdf with the eventdetails and the details of the person that has signed up for an event. I want to have a link to this pdf when the message of book approved is shown.

    Can I do this via a template or do I have to fix this in another way?
    (I think the best way to accomplish this is generating this file whilst submitting the form, and use the submitted values in the pdf. But I'm a bit new to wordpress development, so correct me if I'm wrong)

    http://wordpress.org/plugins/events-manager/

  2. caimin_nwl
    NetWebLogic Support
    Posted 10 months ago #

    You might want to take a look at this file:

    /events-manager/templates/templates/bookings-event-printable.php

    That's an easy to read way of seeing how to get the data you'd need to populate your PDF.

    Depending on how you want the user flow to work, you could link to your own version of this from the main booking confirmation page.

  3. the0and1
    Member
    Posted 10 months ago #

    Thanks, I'll have a look at that. I've found the file, but hadn't thought of that.

  4. angelo
    NetWebLogic Support
    Posted 10 months ago #

    this is not possible out of the box but you can try @caimin suggestion.

  5. the0and1
    Member
    Posted 10 months ago #

    Sorry for my late response, I had some other issues regarding another project I had to work out first.

    Can you explain to me how to create a link to this file when someone subscribed to the event? I can make a link in the succesfull booking text to a file, but I'm not completely sure where to link to. You don't have to be a site user to register for the event btw.

  6. caimin_nwl
    NetWebLogic Support
    Posted 10 months ago #

    A good way to do this might be to copy the file before modifying as described here:

    http://wp-events-plugin.com/documentation/using-template-files/

    That will keep your file safe during upgrades. You can then modify it as needed.

    Another alternative would be to use that file as the basis of a normal template file within your theme.

  7. the0and1
    Member
    Posted 10 months ago #

    I was already using the template file, what I meant was I've created a link in the bookingsform success message:
    <a href="[URL OF MY SITE]/?post_type=event&page=events-manager-bookings&action=bookings_report&event_id=#_EVENTID"> Print your invitation</a>

    But the #_EVENTID isn't replaced with the actual event id, so it just redirects to a page where it only shows a past event. not the one I want to show the reservation for.

    Another problem is when I input the eventid manually (for testing purposes) it also redirects to the page with past events.

  8. caimin_nwl
    NetWebLogic Support
    Posted 10 months ago #

    If you're trying to link to a page that's generated by WP admin (it looks like you are), then I think the structure you need is this:

    YourAdminURL/edit.php?post_type=event&page=events-manager-bookings&event_id=

    Is this code in a template? If it is, you need to do something like this to get the placeholder to work:

    global $post;
    $EM_Event = em_get_event($post->ID, 'post_id');
    
    echo $EM_Event->output('#_EVENTID');
  9. the0and1
    Member
    Posted 10 months ago #

    Yes the page is located in the admin section, but I want this page to be available to every site visitor, now when a visitor is not logged in (like all people signing up for the event), they are asked to login.

    Is there a way to make this happen without the user having to login?

    I finally figured out where the form notices where placed in the bookingform (edited this in a templatefile of events-manager), and I just want to generate a pdf via tcpdf with the info of the event and their name in it. But I'm no coder myself, I understand it, but can't completely write it (well by trial and error I come pretty far).

    Thanks for all the help so far!

  10. angelo
    NetWebLogic Support
    Posted 10 months ago #

    you might need some help from a developer to do this since you are not a coder - http://jobs.wordpress.net/

  11. the0and1
    Member
    Posted 10 months ago #

    Hmm I think I figured out a way to do this. I created a seperate php page which calls the wpdb for the bookings, and takes the latest added booking with a certain event_id. Since I don't know how to get the booking id returned from the form this is the closest I got.

    If someone has a better way (for example making the bookingsform return the booking_id so I can pass it as a var to this page) please let me know!

  12. the0and1
    Member
    Posted 10 months ago #

    Is it possible to make the bookingform return the bookingid? If yes, how can I do this?

  13. philipjohn
    Member
    Posted 10 months ago #

    Hiya,

    The booking form can't return the ID of the booking form, since the booking form is displayed before the booking is created.

    Instead you'll need to retrieve the booking ID through the current user.

    As Angelo stated, you're probably going to need a professional WP developer to help you with this.

    Thanks

Reply

You must log in to post.

About this Plugin

About this Topic