Forums / Templates, Stylesheets, Page Layout / Product Reviews of different languages grouped together in the same page

Product Reviews of different languages grouped together in the same page

Started by tesefoti on 18 Feb 2012, 12:25 PM · Views: 1,085

Results 1 to 2 of 2
18 Feb 2012, 12:25 PM
#1
tesefoti avatar

tesefoti

New Zenner

Join Date:
Jul 2010
Location:
Italy
Posts:
66
Plugin Contributions:
0

Product Reviews of different languages grouped together in the same page

How can I group the reviews even if they are from different languages?
I have 4 reviews in Portugal Portuguese and 1 in Brasil Portuguese and I would like to show the 5 reviews together!
I edited both header_php.php from includes/modules/reviews/pages/product_reviews and product_reviews_info

and removed the lines:

AND pd.language_id = :languagesID

and

  $review_query_raw = $db->bindVars($review_query_raw, ':languagesID', $_SESSION['languages_id'], 'integer');

but it still doesn't group together.

Any idea?
Thanks!

19 Feb 2012, 4:22 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,129
Plugin Contributions:
56

Re: Product Reviews of different languages grouped together in the same page

I think you are changing the SQL query associated with the product information, not the reviews' information. You probably want the product description and name to appear in the language that the current customer has chosen. To display the multiple language reviews, try changing this section (/includes/modules/pages/product_reviews/header_php.php):

  $review_status = " and r.status = 1";

  $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 = :productsID
                        AND r.reviews_id = rd.reviews_id
                        AND rd.languages_id = :languagesID " . $review_status . "
                        ORDER BY r.reviews_id desc";

  $reviews_query_raw = $db->bindVars($reviews_query_raw, ':productsID', $_GET['products_id'], 'integer');
  $reviews_query_raw = $db->bindVars($reviews_query_raw, ':languagesID', $_SESSION['languages_id'], 'integer');
  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
  $reviews = $db->Execute($reviews_split->sql_query);

to this:

  $review_status = " and r.status = 1";

  $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 = :productsID
                        AND r.reviews_id = rd.reviews_id " . $review_status . "
                        ORDER BY rd.languages_id, r.reviews_id desc";

  $reviews_query_raw = $db->bindVars($reviews_query_raw, ':productsID', $_GET['products_id'], 'integer');
/*  $reviews_query_raw = $db->bindVars($reviews_query_raw, ':languagesID', $_SESSION['languages_id'], 'integer'); */
  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
  $reviews = $db->Execute($reviews_split->sql_query);