Display User's Events in their Profile

Home Forums Ticket Products Event Tickets Plus Display User's Events in their Profile

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1060600
    Kyle
    Participant

    I’m using The Events Calendar and Event Tickets Plus with WooCommerce on my site, and I’m hoping to have registered users be able to purchase their tickets and then have upcoming and past events that they are attending displayed on their My Account page.

    Would someone be able to advise me if there is a setting in the plugin that would allow this and if not, if there is a query I could use to retrieve events filtered by the User ID?

    I’m guessing this this should be possible given that administrators are able to view a list of attendees in the backend which lists their name, etc. and I would hope that is tied to their account with WooCommerce if they have one. I know it is tied at least in an abstract way because a WooCommerce order is associated with each attendee and the WooCommerce order would be associated with a user ID if they create an account. I am hoping that there would be a more direct connection though.

    Thanks very much for your help and insight.

    #1060626
    George
    Participant

    Hey Kyle,

    Thanks for reaching out. While this is definitely technically possible, it is unfortunately not anything included in our plugins by default 🙁

    The customization required for this is quite extensive and so the amount of custom coding we could help with is quite limited. That being said, I’m curious – when you say “My Account page”, on which the users will see their “ticketing purchase history”, so to speak, can you clarify what you mean?

    For example, do you mean the admin-facing “my profile” page that is accessible at the URL [domain.com]/wp-admin/profile.php?

    If not, and you mean some other account page, can you clarify which page you mean specifically? Share a screenshot or two if possible, if you don’t mind (you can do so by uploading the screenshot to Imgur.com, Flickr.com, CloudUp.com, or any similar image-hosting site; then just share the links to those images here and I’ll take a look.)


    I ask for this detail because that’s the main variable that will determine the simplicity of implementing this, in my opinion. As you mention, much of the “infrastructure” is already there – associations of user-to-ticket and ticket-to-event and such.

    So getting the data onto the right page is the trick.

    Let me know about the detail I asked about here and I will try to recommend some starter code to get the customization going!

    Thanks,
    George

    #1060645
    Kyle
    Participant

    Hi George,

    Here is a screenshot of the page I’m talking about:

    WooCommerce My Account Page

    I’m sure you’ll recognize this page – the WooCommerce “My Account page” – the front-facing page where customers can view their order history, edit their addresses, etc. As you can see I’ve changed the page title to “My Membership” (per my client’s request)

    Here’s a screenshot of the order detail since it was a ticket purchase:

    Order Detail #771

    My goal would be to add another section to the My Account page (the page that is shown in the first screenshot) with a heading “My Events” and list the events they have purchased tickets to with a link to the event page.

    Ideally I’d prefer to use action/filter hooks and not have to directly edit the My Account template. I’m already using add_action( ‘woocommerce_after_my_account’, ‘xyz_after_my_account’, 0 ); to display some ACF fields at the bottom of the page (I cropped that out of the screenshot to avoid confusion).

    Thanks!

    • This reply was modified 8 years, 3 months ago by Kyle.
    • This reply was modified 8 years, 3 months ago by Kyle.
    • This reply was modified 8 years, 3 months ago by Kyle.
    #1060665
    Kyle
    Participant

    Here is a mockup of what I’m envisioning:

    My Account My Events Section

    #1061437
    George
    Participant

    Hi Kyle,

    I’ve gone ahead and built a custom support plugin for you which you can download here:

    • http://m.tri.be/add-events-to-woo-my-account

    All you have to do is upload and install this like a “normal” WordPress plugin. When activated, it’ll show upcoming events for which the currently-logged-in user has bought tickets.

    Here’s a screenshot of the bare bones styling this plugin provides:

    The point of this plugin is just to get you started with this – you’ll have to take the reins on styling and on getting things looking “just right” for your project needs.

    But this is all set up and ready for more tweaking. Basically, the plugin’s render() function is where the events are looped through, and data displayed. Right now it’s just a list with the event title and schedule details, as seen in the image above. But you can get fancy with this and make tables, and use any of The Events Calendar’s handy template tag functions which are located in your The Events Calendar plugin files here:

    src/functions/template-tags

    There’s a bunch of functions you can use there to display different event data, and so with this and a bit of Googling and tinkering I hope you can pull off what you want.

    Best of luck with your customizing!

    Cheers,
    George

    #1062613
    Kyle
    Participant

    Thanks George, this looks perfect! I’m excited to try this out!

    #1062638
    George
    Participant

    Right on – it’s not a 100% completion of your goals, but should hopefully be a bit of scaffolding you can take and tinker with, and build upon.

    Cheers,
    George

    #1078885
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Display User's Events in their Profile’ is closed to new replies.