WPML
Estado
Esperando al autor
Plugin/tema relacionado
Event Tickets Plus

Resumen del problema

Cuando utiliza el plugin Event Tickets Plus para crear un nuevo evento y añadirle entradas, la sección de entradas no aparece en la página traducida del evento.

Solución alternativa

Por favor, antes de continuar, haga una copia de seguridad completa de su sitio:

  1. Añada el siguiente fragmento de código a WPMLConfiguraciónConfiguración XML personalizada:
     <wpml-config>
        <custom-fields>
            <custom-field action="copy">_ticket_end_date</custom-field>
            <custom-field action="copy">_ticket_start_date</custom-field>
            <custom-field action="copy">_tribe_ticket_capacity</custom-field>
            <custom-field action="copy">_tribe_ticket_show_description</custom-field>
            <custom-field action="copy">_tribe_ticket_version</custom-field>
            <custom-field action="copy">_tribe_tickets_ar_iac</custom-field>
            <custom-field action="copy">_tribe_tickets_meta</custom-field>
            <custom-field action="copy-once">_tribe_wooticket_for_event</custom-field>
        </custom-fields>
    </wpml-config>
  2. Añada el siguiente código al archivo functions.php:
     
    //WPML Workaround
    add_action( 'save_post', 'wpmldp_update_tribe_wooticket_for_event_meta', 999,3 );
     
    function wpmldp_update_tribe_wooticket_for_event_meta( $post_id, $post, $update ) {
    	// Only set for post_type = product
    	if ( 'product' !== $post->post_type ) {
    		return;
    	}
    	//Check if WPML and THe Events Calendar are enabled
    	if (class_exists('SitePress')) {			
    
    		//Get the current ID on "_tribe_wooticket_for_event" meta
    		$current_wooticket_id = get_post_meta($post_id, '_tribe_wooticket_for_event');
    
    		if ( $current_wooticket_id ) {
    			//Get Post Language
    			$wpml_post_language_details = apply_filters( 'wpml_post_language_details', NULL, $post_id ) ;
    			$wpml_current_language = $wpml_post_language_details['language_code'];
    
    			//Check if there is a translation for the $current_wooticket_id. If not, returns the original ID
    			$translated_wooticket_id = apply_filters( 'wpml_object_id', $current_wooticket_id[0], 'page', FALSE, $wpml_current_language);
    
    			//Update post meta with the translated ID
    			if ($translated_wooticket_id) {
    				update_post_meta( $post_id, '_tribe_wooticket_for_event', $translated_wooticket_id );
    			}			
    		}		
    
    	}
    	return;
    }
  3. Cree el evento y añádale entradas.
  4. Traduzca el evento.
  5. Vaya a ProductosTodos los productos y edite la entrada.
  6. Haga una pequeña modificación en la entrada y guarde.
  7. Traduzca la entrada. Tenga en cuenta que si el evento ya existe, solo necesita traducirlo antes de traducir la entrada. Si ambos ya están traducidos, haga una pequeña modificación en la entrada original y luego actualice la traducción.

Si está utilizando el plugin The Events Calendar, tendrá que cambiar esta línea:

 $translated_wooticket_id = apply_filters( 'wpml_object_id', $current_wooticket_id[0], 'page', FALSE, $wpml_current_language); 
Por:
 $translated_wooticket_id = apply_filters( 'wpml_object_id', $current_wooticket_id[0], 'tribe_events', FALSE, $wpml_current_language); 

Siguientes pasos

Event Tickets Plus y WPML aún no son totalmente compatibles, pero nos gustaría trabajar en colaboración con el equipo de The Events Calendar para lograrlo. Si la compatibilidad de este plugin con WPML es importante para usted, por favor, infórmeselo al equipo de The Events Calendar a través de su foro de soporte público o sus canales de soporte privados y podremos intentar avanzar en esto juntos.

Todos los problemas conocidos →