Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problem Viewing Reviews


Anello

Recommended Posts

I am having a problem with my reviews page. Whenever I try to view the reviews for a product, the page fills in fields with a "T". For example:

by T Date Added: Wednesday 31 December, 1969

T

 

Rating: [T of 5 Stars!]

 

and also fails to load the image (alt is also "T").

I know the review itself is fine since I can log into the Admin page and view the review exactly as it should be, the admin preview works fine, too. It is only viewing the reviews through the actual catalog that causes problems.

I know it is not an isolated problem since a quick google search found over a dozen other oscommerce stores with the same error.

Does anyone have an idea about what might be causing this? Permissions? Faulty MySQL tables?

I have already tried replacing product_reviews_write.php, product_reviews_info.php, product_reviews.php, and product_info.php with original copies - did nothing.

 

Might have something to do with Separate Pricing Per Customer, but I doubt it.

Thanks.

Link to comment
Share on other sites

Michael,

 

Do you have the Review info box in the left column or right?

 

ed

 

It is in the right column, but I am using STS, so it might not correspond directly with the original template setup.

Link to comment
Share on other sites

It is in the right column, but I am using STS, so it might not correspond directly with the original template setup.

I saw this exact thing happen (meaning, the "T"s showing up) when I moved the review info box from the default right column to the left column. It appears to be a variable scoping issue. What I did to fix it was to go into the reviews.phph file (I think that's the right name) and change the variable names. So, if a variable was $foo, I made it $foo_x. That cleared it up. I should have figured out which variable was the problem but this worked, quickly.

 

ed

Link to comment
Share on other sites

OK, I fixed the problem thanks to your question, ed.

It seems that STS has an error with overwriting the variable $review in the file /includes/boxes/reviews.php

by renaming the variable to something else, you can fix the problem.

For anyone else who runs into the problem, here is the original (STS) code and the fixed code:

 

// display random review box

$review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");

$review = tep_db_fetch_array($review_query);

 

$review = tep_break_string(tep_output_string_protected($review['reviews_text']), 15, '-<br>');

 

 

REPLACE WITH:

// display random review box

$review_query = tep_db_query("select substring(reviews_text, 1, 60) as reviews_text from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . (int)$random_product['reviews_id'] . "' and languages_id = '" . (int)$languages_id . "'");

$reviews_text = tep_db_fetch_array($review_query);

 

$reviews_text = tep_break_string(tep_output_string_protected($reviews_text['reviews_text']), 15, '-<br>');

 

That should do it! Thanks again for the post ed.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...