WPML
상태
개발자 대기 중
관련 플러그인/테마
Event Tickets Plus

문제 개요

Event Tickets Plus 플러그인을 사용하여 새 이벤트를 생성하고 티켓을 추가할 때, 번역된 이벤트 페이지에 티켓 섹션이 표시되지 않습니다.

임시 해결 방법

계속 진행하기 전에 사이트를 전체 백업하세요.

  1. WPML설정사용자 정의 XML 구성에 다음 스니펫을 추가하세요.
     <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. 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. 이벤트를 생성하고 티켓을 추가하세요.
  4. 이벤트를 번역하세요.
  5. 제품모든 제품으로 이동하여 티켓을 편집하세요.
  6. 티켓을 약간 수정한 후 저장하세요.
  7. 티켓을 번역하세요. 이벤트가 이미 존재하는 경우 티켓을 번역하기 전에 이벤트를 번역해야 합니다. 둘 다 이미 번역된 경우 원본 티켓을 약간 수정한 다음 번역을 업데이트하세요.

The Events Calendar 플러그인을 사용하는 경우 다음 줄을 변경해야 합니다.

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

다음 단계

Event Tickets Plus와 WPML은 아직 완전히 호환되지 않지만, 당사는 The Events Calendar 팀과 협력하여 이 문제를 마무리하고자 합니다. 이 플러그인과 WPML의 호환성이 중요한 경우 The Events Calendar 팀의 공개 지원 포럼 또는 비공개 지원 채널을 통해 해당 팀에 알려주시면 당사도 함께 이 작업을 추진해 볼 수 있습니다.

알려진 모든 문제 →