Help Desk

Recurring Event – Display All not showing All in popup

  • Posts: 9 Topics: 5
    | Permalink

    I have an event that has a recurring option for three other dates for the event.
    They are created with ONCE as the repeating option.

    However, when we hover over “See All”, the first event does not get listed.

    The screenshot below shows only two of the three events that you can clearly see on screen.

    Can you help please ?

    Posts: 4906 Topics: 10
    | Permalink

    Hi Sean!

    Thanks for getting in touch with us. Let me help you with this topic.

    By default, that tooltip does not show the main event for the recurring instances, so that is the expected behaviour.

    However, I can see the point of wanting to have all the available instances for the event. Do you need the main event to always show up in the tooltip? If so, let me know and I will try to come up with a snippet to accomplish that.

    Thanks,
    Victor

    Posts: 9 Topics: 5
    | Permalink

    Yes we do.

    If you are in one of the “not main events” and hover over the tooltip activator, then I would expect it to show the main event, as that is another available date for that family of events, that’s just obvious to us.

    If you could let us have a snippet to achieve this please that would be great.

    Posts: 4906 Topics: 10
    | Permalink

    Hi Sean!

    I’m sorry for a bit of delay here.

    Please let me note that we are fairly limited in how much support we can give for custom development questions. But, we always like helping out and at least point users into the right direction as much possible.

    I’ve come up with a snippet to add the first date of the recurring event series to the tooltip. You will need to copy and paste the following snippet into your theme’s functions.php file:

    /*
    * Add First Event date on recurring info tooltip
    */
    add_filter( 'tribe_get_recurrence_text', 'add_first_event_date' );
    function add_first_event_date( $recurrence_text ) {
        $parent_date = '<p>First Event on ' . tribe_get_start_date() . '</p>';
        $recurrence_text = $parent_date . $recurrence_text;
    
    return $recurrence_text;
    }
    

    Please try it out and let me know if it works for you.

    Best,
    Victor

    Posts: 9 Topics: 5
    | Permalink

    HI,

    This does not work correctly, as it just shows the current event date again, not the first event date for the appropriate set of events.

    [cid:image001.png@01D3A4D2.42CD3AF0]

    Thank you

    Sean Clarke * Clarke Design * Helping your business untangle the web

    Email: web@clarkedesign.co.uk

    Web: http://www.clarkedesign.co.uk

    Tel: 01270 761331

    Clarke Website Design Ltd is registered in England and Wales under company number 07324906 and our registered office is at 9 Ossmere Close, Sandbach, Cheshire CW11 1FB

    Clarke Design is a trading name of Clarke Website Design Ltd. Clarke Design operates under the Clarke Website Design Ltd Terms and Conditions

    All email communications are private and confidential to the intended addressee. If you believe you have received this email in error please delete it and inform our office at: web@clarkedesign.co.uk

    Posts: 9 Topics: 5
    | Permalink

    HI,

    We’ve rewritten this code so that it works now.

    add_filter( ‘tribe_get_recurrence_text’, ‘cwd_add_first_event_date’ );
    function cwd_add_first_event_date( $recurrence_text ) {

    $recurrence_text = '';
    
    $date_format = tribe_get_datetime_format();
    $recurrence_start_dates = tribe_get_recurrence_start_dates();
    
    foreach ( $recurrence_start_dates as $recurrence_start_date ) {
        $recurrence_start_date_formatted = date( $date_format, strtotime( $recurrence_start_date ) );
    
        $recurrence_text .= '<p>Course on ' . $recurrence_start_date_formatted . '</p>';
    }
    
    return $recurrence_text;
    

    }

    Thank you
    Sean Clarke · Clarke Design · Helping your business untangle the web
    Email:    web@clarkedesign.co.uk
    Web:     http://www.clarkedesign.co.uk
    Tel:       01270 761331

    Clarke Website Design Ltd is registered in England and Wales under company number 07324906 and our registered office is at 9 Ossmere Close, Sandbach, Cheshire CW11 1FB

    Clarke Design is a trading name of Clarke Website Design Ltd. Clarke Design operates under the Clarke Website Design Ltd Terms and Conditions

    All email communications are private and confidential to the intended addressee. If you believe you have received this email in error please delete it and inform our office at: web@clarkedesign.co.uk

    Posts: 4906 Topics: 10
    | Permalink

    Right on Sean! I’m glad you could tweak the code to achieve exactly what you were looking for 🙂

    Thanks for following up to share the code so others can also benefit from it.

    It seems you are set here so I’ll go ahead and close this thread, but don’t hesitate to open a new topic if anything comes up and we’ll be happy to help.

    Cheers,
    Victor

    | Permalink

The topic ‘Recurring Event – Display All not showing All in popup’ is closed to new replies.