• Resolved Erwinnet

    (@erwinnet)


    I’m using the plugin ‘Registrations for The Events Calendar’ for a non-profit association to make an inventory and register volunteers on events.

    Is it possible to show the status (amount of registrations) in the ‘list view’ in The Events Calendar? For example: two/one persons or registrations are filled.

    Is it possible to show this notification in another color?
    – Two/one or more persons (red color)
    – registrations are filled (green)

    Thank you for the assistance!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author roundupwp

    (@roundupwp)

    Hey Erwinnet,

    Yes this is possible with a bit of PHP code. For others looking for help with this, there is a blog post on how you can add customizations to different parts of The Events Calendar here: https://roundupwp.com/customize-events-calendar-single-event-templates/

    For your specific use, you would want to add this code in your functions.php file for your theme. Be very careful when adding this as a mistake can cause your site to crash:

    Here is the PHP code that will add the notice:

    function rtec_custom_registration_count_display() {
    	// Only run this code if Registrations for the Events Calendar is active
    	if ( function_exists( 'rtec_get_event_meta' ) ) {
    		$event_id                = get_the_ID();
    		// Get information about this event related to registrations
    		$event_meta = rtec_get_event_meta( $event_id );
    		// If this event has limited seats
    		if ( $event_meta['limit_registrations'] ) {
    			// Calculate the number of seats remaining and display a note
    			$registrations_remaining = $event_meta['max_registrations'] - $event_meta['num_registered'];
    			if ( $registrations_remaining < 1 ) {
    				echo '<div class="tribe-events-event-cost rtec-custom-limit rtec-green"><span>Full</span></div>';
    			} elseif ( $event_meta['num_registered'] > 0 ) {
    				echo '<div class="tribe-events-event-cost rtec-custom-limit rtec-red"><span>' . $event_meta['num_registered'] . ' volunteering</span></div>';
    			}
    		}
    	}
    
    }
    add_action( 'tribe_events_before_the_meta', 'rtec_custom_registration_count_display' );

    You will also need to add this CSS to the “Custom CSS” area on the “Form” tab:

    .tribe-events-event-cost.rtec-custom-limit {
        float: none !important;
        display: inline-block;
        margin: 0 0 5px !important;
    
    }
    .tribe-events-list .tribe-events-event-cost.rtec-custom-limit.rtec-red span {
        background: #FDA7AD;
        border-color: #FC8089;
    }
    .tribe-events-list .tribe-events-event-cost.rtec-custom-limit.rtec-green span {
        background: #C8F6F1;
        border-color: #68CDC2;
    }

    Let me know if you have more questions!

    – Craig

    Plugin Author roundupwp

    (@roundupwp)

    I forgot to mention, you can change the text “Full” and “volunteering” to whatever you need for your use as well.

    I hope you are having a great start to your week!

    Thread Starter Erwinnet

    (@erwinnet)

    Thanks for help! It works! Great support!

    Plugin Author roundupwp

    (@roundupwp)

    No problem! Thank you so much for leaving the review as well! That really helps us out.

    Let me know if you ever need anything else.

    Thanks,

    Craig

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Show status registration in list view’ is closed to new replies.