문제 개요
WooCommerceWPML Multilingual & Multicurrency for WooCommerce설정 페이지의 Show reviews in all languages 옵션과 함께 Customer Reviews for WooCommerce 플러그인의 숏코드를 사용하여 제품 페이지에 리뷰를 표시하는 경우, 번역된 제품 버전에서 리뷰가 표시되지 않는 문제가 발생할 수 있습니다.
임시 해결 방법
이 문제는 해결되었습니다. 최신 버전으로 업데이트하면 사이트에서 이 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.
진행하기 전에 사이트의 전체 백업을 완료했는지 확인하세요.
- …/wp-content/plugins/customer-reviews-woocommerce/includes/blocks/class-cr-reviews-grid.php 파일을 여세요.
- 148번째 줄을 찾으세요.
- 다음 코드 블록 뒤에:
$args = array( 'status' => 'approve', 'post_type' => 'product', 'meta_key' => 'rating', 'orderby' => $order_by, 'post__in' => $post_ids, 'comment__not_in' => $comment__not_in );
- 다음을 추가하세요:
if (is_array($args['post__in']) && count($args['post__in']) === 1) { $args['post_id'] = array_shift($args['post__in']); unset($args['post__in']); }