Support » Plugin: Event Tickets » RSVP Tickets 4.2.6 Messages

  • Resolved Merv

    (@mervforneyerolscom)


    Testing this version before upgrade and see messages were added for tickets not available if purchase date/time window closes and a bit different message when the event has passed.

    How can I modify the messages?
    I don’t see an option in Admin -> Events -> Settings.
    Is there a hook?

    Thanks,
    Merv

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Clifford Paulick

    (@cliffpaulick)

    Hi Merv.

    Could you please provide a screenshot and/or copy & paste the text of the message you’re referring to?

    Merv

    (@mervforneyerolscom)

    Hi Clifford,
    I found the code for the messages in question:
    event_tickets => src => Tribe = Tickets.php about line 1288 in version 2.4.7:

    		/**
    		 * Returns a tickets unavailable message based on the availability slug of a collection of tickets
    		 *
    		 * @since 4.2
    		 *
    		 * @param array $tickets Collection of tickets
    		 *
    		 * @return string
    		 */
    		public function get_tickets_unavailable_message( $tickets ) {
    
    			$availability_slug = $this->get_availability_slug_by_collection( $tickets );
    			$message           = null;
    			$post_type = get_post_type();
    
    			if ( 'tribe_events' == $post_type && function_exists( 'tribe_is_past_event' ) && tribe_is_past_event() ) {
    				$events_label_singular_lowercase = tribe_get_event_label_singular_lowercase();
    				$message = sprintf( esc_html__( 'Tickets are not available as this %s has passed.', 'event-tickets' ), $events_label_singular_lowercase );
    			} elseif ( 'availability-future' === $availability_slug ) {
    				$message = __( 'Tickets are not yet available.', 'event-tickets' );
    			} elseif ( 'availability-past' === $availability_slug ) {
    				$message = __( 'Tickets are no longer available.', 'event-tickets' );
    			} elseif ( 'availability-mixed' === $availability_slug ) {
    				$message = __( 'There are no tickets available at this time.', 'event-tickets' );
    			}
    
    			/**
    			 * Filters the unavailability message for a ticket collection
    			 *
    			 * @var string Unavailability message
    			 * @var array Collection of tickets
    			 */
    			$message = apply_filters( 'event_tickets_unvailable_message', $message, $tickets );
    
    			return $message;
    		}
    

    I would love to be able to modify these messages in my child theme for my client who refers to Tickets as Registrations.

    Merv

    Plugin Contributor nicosantos

    (@nicosantos)

    Thanks for following up Merv! To change tickets for registrations in the tickets unavailable messages just paste the code below in your theme’s (or child theme’s) <kbd>functions.php</kbd> file:

    /* Tribe, modify tickets unavailable messages */
    function tribe_customize_tickets_unvailable_message ( $message, $tickets ) {

    $message = str_replace('Tickets','Registrations',$message);
    $message = str_replace('tickets','registrations',$message);

    return $message;
    }

    add_filter( 'event_tickets_unvailable_message', 'tribe_customize_tickets_unvailable_message', 10, 2 );

    This should do the trick for you 🙂

    Best,
    Nico

    Hi Nico,

    I’m have a simular problem with changing the wording of the “Tickets Unavailable Message” on the single event page in Event Tickets . I located the file which controls this message at /wp-content/plugins/event-tickets/src/Tribe/tickets.php line 1376.

    I’m not sure how to implement it into the function.php file, what the hook would be. There is no entry in any of the translation files, which is how I normally would change wording. Strangely, all the other messages can be found in the translation pot file except the “Tickets Unavailable Message”

    Any assistance would be appreciated.

    Plugin Contributor GeoffBel

    (@geoffbel)

    Hey James,

    You might want to try to update your po files from the pot file or grab the latest copy of your language’s files here: http://translations.theeventscalendar.com/projects

    Normally, these should be visible in Event Tickets’ po/mo files.

    Let us know how that goes.

    Best regards,
    Geoff B.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘RSVP Tickets 4.2.6 Messages’ is closed to new replies.