Display number of people attending + widget

Home Forums Calendar Products Events Calendar PRO Display number of people attending + widget

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #951287
    Antoine
    Participant

    Hi,

    I have 2 issues:

    1. I would like to display the number of people maximum that can attend to the event. I think the best idea is to use the total number ticket in sale. But do you have an idea of how implementing that in the single page event or event in the event list ?

    2. I would like to display my Widget event list horizontally.
    Like that :
    Event – Event – Event
    Instead of :
    Event
    Event
    Event

    I went through your forum and I read already some post about that, but even editing CSS and floating, I had no result, not event close.
    Do you have any idea ?

    Many thanks for your help

    #951416
    Brook
    Participant

    Howdy Antoine!

    We’d love to help. It’s nice to meet you for sure.

    Regarding your first question, that is possible. It sounds like this is the function you are looking for: tribe_events_count_available_tickets() – Counts the total number of tickets still available for sale for a specific event. You can add this anywhere, including the single-event.php template. It sounds like you are already familiar with theme overrides, but if not here is a guide.

    For number two, again it is very possible. You will need to do a couple of very important things to get that started:

    1. Make the widget container wider enought to hold multiple events side by side. In my case it was as simple as the see .widget{width:100%;}. But, this will vary massively from theme to theme.
    2. Turn the widgets into inline-blocks or float them. In my case all I needed was this code .widget .type-tribe_events{float:left;}

    That’s easy right? Well sort of. If your theme is the same as mine then it will float at least some of the venues into a horizontal list. But, there is a lot of work left to get them styled right and looking great. Unfortunately I can not help much with that though, it falls well outside our scope of support. Our goal is to provide nice overviews of what folks need to do, but it is up to you or your team to apply them specifically to your site. In short, we can not build customizations for you, only instruct you on how to build them.

    Did that help solve your problems? Do you have any other questions I can help with, or something I can clarify? Please let me know. Cheers!

    – Brook

    #951553
    Antoine
    Participant

    Hi Brook,
    Nice to meet you and thanks for your reply.

    1. About my first problem, It is not exactly what I want. I don’t want to show how tickets are still available, I would like to show how many people maximum could attend to the event. So this number will not change and this number is the same as the total number of tickets in sale when the event is launching. You follow me ? 🙂

    2. Thanks for the code but It doesn’t work. Where do you put these lines ? In the “theme CSS” of “tribe-events-pro-theme.css” ?

    Cheers,

    Antoine

    #951921
    Brook
    Participant

    You are certainly welcome for the help Antoine.

    I got you now. Then you should be able to use this function, it’s just a slight modification of the existing tribe_events_count_available_tickets(). You could add this to your theme’s functions.php file, then call it anywhere you need to see how many tickets are available + how many have sold (the total initial amount that was available).

    function tribe_events_count_all_tickets( $event = null ) {
    $count = 0;
    
    if ( null === ( $event = tribe_events_get_event( $event ) ) ) {
    return 0;
    }
    
    foreach ( TribeEventsTickets::get_all_event_tickets( $event->ID ) as $ticket ) {
    $count += $ticket->stock;
    $count += $ticket->qty_sold;
    }
    
    return $count;
    }

    I am sorry, I must not have been clear before. That CSS will only work if your theme is identical to mine (Twenty Fourteen from WordPress). It was not meant to be a solution to your theme, that’s why I said “If your theme is the same as mine…” It was just an example of how to start doing it in the one theme. You could put that CSS in any file that gets loaded by your theme, including the main style.css or child theme stylesheet. If some of this sounds like you Greek to you, or you just do not feel like you know how to convert a vertical list to a horizontal one in CSS, then you might just need to hire a CSS expert to write those up for you. They are pretty in depth sort of customization that will require a lot of custom code specific to your site in order to get everything working right.

    Does that all make sense? Is there anything else I can help with?

    Cheers!

    – Brook

    #951944
    Antoine
    Participant

    Hi Brook,

    1. Thanks for the code. Just then how I call it on single event page for example?
    2. Got you for the CSS, I will try find the solution with my theme.
    3. Finally, How can I display the call to action block only on the homepage ?
    because it appears on every page.

    Thanks, That was my last questions

    #952271
    Brook
    Participant

    Awesome! I am happy that information helped. Regarding your three questions:

    1. Thanks for the code. Just then how I call it on single event page for example?

    You can just call tribe_events_count_all_tickets() from any PHP code block. Further you can modify the single event page PHP file, single-events.php, by following this tutorial on creating theme overrides. I hope that tutorial helps, it is quite detailed and provides some good examples. But it is once again geared towards people with theming knowledge because unfortunately theming experience is just necessary for modifying templates and themes.

    2. Got you for the CSS, I will try find the solution with my theme.

    You are super welcome. 🙂

    3. Finally, How can I display the call to action block only on the homepage ?
    because it appears on every page.

    There are three possible ways. If it is HTML you could just adding in WP Admin > Events > Settings > Display, and scroll down to “Add HTML before event content”. See if that works for you.

    If not, try going back to WP Admin > Events > Settings > Display, and this time looking at the “Events template” drop down. Try selecting a different template and clicking save, then viewing the front end. One of these templates might already have your call to action in it.

    Finally, using the theme overrides guide I linked to above, you can throughly customize any part of the templates to look exactly like you want, even match the rest of your site perfectly. But, this route requires theming experience.

    Did that answer everything clearly? Can I help in any other way? Thanks Antoine!

    – Brook

    #975484
    Brook
    Participant

    Since this topic has been inactive for a spell we are going to archive it. Please note, if you need anything else or something is not yet resolved please open a new topic. We would love to help!

    Cheers!

    – Brook

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Display number of people attending + widget’ is closed to new replies.