Navigation überspringen

Open

Topic Tags: Compatibility

Overview of the issue

If you are using the Events Manager plugin, you may encounter an issue where ticket details for recurring events do not display translated in secondary languages.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Open the …/wp-content/plugins/events-manager/classes/em-ticket.php file.
  • Look for line 150.
  • Replace:
    function __get( $var ){
    	if( $var == 'name' || $var == 'ticket_name' || $var == 'description' || $var == 'ticket_description' ){
    		$prop = $var == 'name' || $var == 'description' ? 'ticket_'.$var : $var;
    		if( EM_ML::$is_ml && !$this->ticket_parent && !empty($this->ticket_meta['langs'][EM_ML::$current_language][$prop]) ){
    			return $this->ticket_meta['langs'][EM_ML::$current_language][$prop];
    		}else{
    			return $this->{$prop};
    		}
    	}elseif( $var == 'event' ){
    
  • With:
    function __get( $var ){
    if( $var == 'name' || $var == 'ticket_name' || $var == 'description' || $var == 'ticket_description' ){
    	$prop = $var == 'name' || $var == 'description' ? 'ticket_'.$var : $var;
    
    	// WPML Workaround for compsupp-7315
    	if ( class_exists('Sitepress') 
    		&& isset( $this->ticket_id ) 
    		&& isset( $this->event->post_id ) ) {
    
    		$string_name = 'ticket_description_'.$this->ticket_id;
    		$textdomain = 'event-tickets-'.$this->event->post_id ;
    		$this->{$prop} = apply_filters('wpml_translate_single_string', $this->{$prop} , $textdomain, $string_name);
    
    	}
    	else if ( $prop == 'ticket_name' ) {
    		$string_name = 'Ticket Name:'.substr($this->{$prop}, 0, 20);
    		$textdomain = 'events-manager' ;
    
    		if ( apply_filters('wpml_default_language', NULL ) == apply_filters( 'wpml_current_language', NULL )) {
    			do_action( 'wpml_register_single_string', $textdomain, $string_name, $this->{$prop} );
    		}	
    
    		$this->{$prop} = apply_filters('wpml_translate_single_string', $this->{$prop} , $textdomain, $string_name);
    	}
    
    	if( EM_ML::$is_ml && !$this->ticket_parent && !empty($this->ticket_meta['langs'][EM_ML::$current_language][$prop]) ){
    		$check = $this->ticket_meta['langs'][EM_ML::$current_language][$prop];
    		return $this->ticket_meta['langs'][EM_ML::$current_language][$prop];
    	}else{
    		return $this->{$prop};
    	}
    }elseif( $var == 'event' ){
    
  • Visit the page with the issue in original language.
  • Go to WPML > String Translation page, search for the strings and translate them.

2 Antworten zu “Events Manager - Translated Recurring Event Tickets Not Displaying”

    • Hi Caterina,

      Thanks for reaching out, and I’m sorry for the inconvenience this has caused.

      • We reported this issue to the plugin author but haven’t received any response or feedback from them. I’d encourage you to contact their support as well—if more users report it, they may prioritize it.
      • Regarding the locked strings, it looks like they were sent for translation as part of a string package, which is why you’re unable to edit them individually. Please check under WPML > String Packages to see if there’s a package awaiting translation. If the issue persists, I recommend starting a chat on our support forum, where one of our team members will be happy to assist you further.

Eine Antwort hinterlassen

Bitte bleiben Sie beim Thema und verhalten Sie sich anderen gegenüber respektvoll. Wenn Sie Hilfe bei Problemen benötigen, die nicht mit diesem Beitrag zusammenhängen, nutzen Sie unser Support-Forum, um einen Chat zu starten oder ein Ticket einzureichen.

Sie können diese Tags verwenden:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>