WPML
상태
해결됨
유형
버그
보고 대상
WPML Multilingual & Multicurrency for WooCommerce 5.3.9
해결된 버전
WPML Multilingual & Multicurrency for WooCommerce 5.6.0
주제 태그
Bug, WCML

문제 개요

WPML Multilingual & Multicurrency for WooCommerce는 단일 상품 페이지의 리뷰 탭에 표시되는 상품 리뷰를 올바르게 번역합니다. 하지만 WooCommerce의 리뷰 블록을 사용할 때는 번역된 리뷰가 표시되지 않습니다. 대신 원본 언어 리뷰가 표시됩니다.

임시 해결 방법

WPML Multilingual & Multicurrency for WooCommerce 5.6.0 이상으로 업데이트하세요. 이제 번역된 검토가 WooCommerce 검토 블록에도 표시됩니다. 업데이트한 후에는 테마에 추가했던 아래의 스니펫을 제거하세요.

아직 업데이트할 수 없는 경우:

진행하기 전에 전체 사이트 백업을 완료했는지 확인하세요.
  • 테마의 functions.php 파일을 여세요.
  • 다음 스니펫을 추가하세요:
    add_filter( 'get_comment', 'translate_comment' );
    function translate_comment( $comment ){
    
        if ( !is_singular('product') && isset( $comment->comment_type ) && $comment->comment_type === 'review' && isset( $comment->comment_content ) ) {
            $name = 'product-'.$comment->comment_post_ID.'-review-'.$comment->comment_ID;
            $comment->comment_content = apply_filters( 'wpml_translate_single_string', $comment->comment_content, 'wcml-reviews', $name );
        }
        
        return $comment;
    }

모든 알려진 문제