WPML
ステータス
開発者により解決済み
関連するプラグイン/テーマ
Customer Reviews for WooCommerce
トピックタグ
Compatibility

問題の概要

Customer Reviews for WooCommerceプラグインのショートコードを使用して商品ページにレビューを表示し、WooCommerce → WPML Multilingual & Multicurrency 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']);
    			}

すべての既知の問題 →