Jump to content



Issue Information

  • #000138

  • 1 - Low

  • Fixed

  • 2.3.1

  • 2.3.3

Issue Confirmations

  • Yes (0)No (0)
Photo

No Reviews Other Than English

Posted by yansfung on 15 November 2010 - 01:18 PM

I tried to duplicate English language pack to tchinese (Traditional Chinese) from V2.3.1.

During the bi-lingual test for V2.3.1, it found that a Review message submitted, approved and viewed properly under English environment. However, when switched to Chinese environment, non-Reviews (目前沒有產品評價 prompted, it is my translation).

Who else got the similar problem?

If you check the query that pull reviews into the page you'll see that it selects only reviews approved and written on selected language (language ID).

product_info.php


cc 190. line

FIND:

     $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1");
  

REPLACE WITH:

    $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");

Edited by DiablOCorsa, 24 November 2010 - 03:02 PM.


Sorry!

product_info.php


cc 190. line

FIND:

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1");

REPLACE WITH:

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_status = 1 and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");

The error of the Review system can be found in the previous version, too; on the product information page the Review Counter doesn't work properly.

1. possible solution is written in my previous post
According to the correction above, the counter on the product information page will display the number of reviews that can be seen in the current language.

Before the correction, the counter shows the number of reviews regardless of their language. However, if you click on the link, you will see only those reviews that were written in the chosen language. If we make this correction, the counter will count only that many reviews which can be seen in the current language also.

2. possible solution

The counter will display the number of reviews regardless of their language.

If you need this, make the following modification instead of the one above:

product_rewiews.php

line 7
  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "' and r.reviews_status = 1 order by r.reviews_id desc";

replace with this:
  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$product_info['products_id'] . "' and r.reviews_id = rd.reviews_id and r.reviews_status = 1 order by r.reviews_id desc";


3. possible solution
We import a new constant into the configuration table, with which (the new constant) we can set the visibility of the reviews from the admin page to display them with or without language filteration. That's a little more complicated, I'll write the solution if someone is interested.

Thanks very much indeed!

Your 2nd solution works fine for my expected behaviour in multi-lingual environment.

Cheers!!
:D
[quote name='DiablOCorsa' date='25 November 2010 - 01:33 AM']

2. possible solution

The counter will display the number of reviews regardless of their language.

If you need this, make the following modification instead of the one above:

product_rewiews.php

line 71


replace with this:


Updating severity to: 2 - Fair
Updating status to: Confirmed

Updating status to: Fixed

changed fixed-in version to: 2.3.3

changed severity to: 1 - Low