Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

reviews show in product but not in reviews section


Guest

Recommended Posts

After further testing here is what's happening.

 

If I leave the reviews code only in the right column surrounded by <?php ?> tags the reviews box shows up at the bottom of the left column and it does work:

 

http://www.bandtobow.com/catalog/product_r...4&reviews_id=27

 

If I move that code only to the left column the reviews show in the reviews list when you click on the reviews arrow with the deprecated text but after you click that link to read all of the review the review, stars, and image is gone.

 

How do you move require(DIR_WS_BOXES . 'reviews.php'); to the left side where the other boxes are?

Link to comment
Share on other sites

I just checked your site and everything appears to work correctly unless I missed something.

 

From the page, I clicked the arrow in the Reviews box to receive a list of all reviews. The reviews box was still correct.

 

Clicking on a review from the list to receive the review detail, the review box was still okay.

 

What did I miss or did you get it corrected?

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

I am sorrty to report but it still works fine for me. :huh:

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

I get:

 

All for One Price

[ds_allsets] $780.00

by T Date Added:

T

 

Rating: [T of 5 Stars!]

 

No review. Just Ts on that page (not in the box, in the content of the page to which she links). On a different review I get Ds. Letter also changes if I refresh the page.

 

Goofy.

 

Matt

Link to comment
Share on other sites

Okay, I get what is happening now.

 

I thought those letters were just test entries. :blink:

 

Do a print_r on the query results for the review to determine if the query results are messed up.

 

If they look correct, then look later on in the code to see if any functions are being applied to the query result field information prior to display.

 

Something somewhere is hoarking thinks up.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

I'm having the same problem.... it all worked fine and it just stopped. i have 40+ reviews. I did not modify the review.php at all. when I find a fix i'll post it

 

http://www.frontiersofhealth.com/product_r...4/reviews_id/27

<span style='font-family:Courier'>If you can't fix it Perl it!!!...</span>

******************************

Link to comment
Share on other sites

the reviews page laysout correct. the review box is fine. it just when you click on the review to read it indepth.

strange.....indeed

<span style='font-family:Courier'>If you can't fix it Perl it!!!...</span>

******************************

Link to comment
Share on other sites

Do a print_r on the query results for the review to determine if the query results are messed up.

 

If they look correct, then look later on in the code to see if any functions are being applied to the query result field information prior to display.

 

uhhh Jim how do I do what you said? :rolleyes:

Link to comment
Share on other sites

Around 76-77 of reviews.php, I have

    $reviews_query = tep_db_query($reviews_split->sql_query);
   while ($reviews = tep_db_fetch_array($reviews_query)) {

I think that he is suggesting that you add

print_r($reviews);

immediately after that. If that is working, you may have to do additional debugging later in the code. Note: assumes that you have a relatively new version of PHP. print_r was added relatively recently (4.2 or 4.3 I think).

 

Hth,

Matt

Link to comment
Share on other sites

Mordom!! it's workiing... i just looked at your site and it's working... did you add the the print_r code?

<span style='font-family:Courier'>If you can't fix it Perl it!!!...</span>

******************************

Link to comment
Share on other sites

Nope it's not working... I jumped the gun... the details are still broke. the teaser is still up

<span style='font-family:Courier'>If you can't fix it Perl it!!!...</span>

******************************

Link to comment
Share on other sites

I'm thinking that print_r is doing absolutely nothing. Either I wrote the command wrong, or it's not supported in her version of PHP. Either way, it's debugging code, not functional code. If it were working, it would output a bunch of cruft that might help us guess at the problem. It's not doing that.

 

Hth,

Matt

Link to comment
Share on other sites

Matt was correct in his code suggestion and I find it odd that you did not receive any type of output.

 

Let's try the following:

 

1. At the beginning of the file after the call to require application_top, add the following:

// Display a variables contents
 function akoza_debug_var($cText, $xVar) {
   $cText = $SCRIPT_NAME . $cText;
   if (is_array($xVar) || is_object($xVar)) {
     echo "<p>$cText:</p>\n<pre>\n";
     print_r($xVar);
     reset($xVar);
     echo "</pre>\n";
   } else {
     echo "<p>$cText: $xVar</p>\n";
   }
 }

 

2. Then in the area that Matt pointed out which are lines 76 and 77 in v1.51 of the reviews.php file in an MS2 release, looks like:

    $reviews_query = tep_db_query($reviews_split->sql_query);
   while ($reviews = tep_db_fetch_array($reviews_query)) {

make it look like:

    $reviews_query = tep_db_query($reviews_split->sql_query);
   while ($reviews = tep_db_fetch_array($reviews_query)) {
akoza_debug_var('$reviews', $reviews);

If nothing else, you will now have several lines (1 for each review on the page) that say $reviews so at least we know whether that we are getting to that point of execution.

 

Preferably, you should have some data for us to look at.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Hi,

 

I have this:

$reviews:

 

Array

(

[reviews_id] => 1

[reviews_text] => this is a test review ... this is a test review ... this is a test review ... this is a test review

[reviews_rating] => 5

[date_added] => 2003-10-25 11:39:22

[products_id] => 1

[products_name] => test

[products_image] => arrow_green.gif

[customers_name] => Melinda Odom

)

 

 

on this page:

http://209.197.245.49/reviews.php

 

But when you click to go inside the review you get nothing.

Link to comment
Share on other sites

Yep, we were working on the wrong file. :) Sorry about that.

 

Cut the function from the top of the reviews file and place it in the same place in the product_reviews_info.php file.

 

Edit product_reviews_info.php and lines 29 should read:

  $review = tep_db_fetch_array($review_query);

add the

akoza_debug_var('$review', $review);

line immediate after that and let me know the results.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Hi,

 

I edited product_reviews_info.php

 

The results are at the top of the page after you click to get inside the review:

 

$review:

 

Array

(

[reviews_text] => this is a test review ... this is a test review ... this is a test review ... this is a test review ...

[reviews_rating] => 5

[reviews_id] => 1

[customers_name] => Melinda Odom

[date_added] => 2003-10-25 11:39:22

[reviews_read] => 34

[products_id] => 1

[products_price] => 10.0000

[products_tax_class_id] => 1

[products_image] => arrow_green.gif

[products_model] =>

[products_name] => test

)

 

Url is:

http://209.197.245.49/product_reviews_info...=1&reviews_id=1

Link to comment
Share on other sites

Okay, that means that the reviews text is there as the previous page already told us.

 

Look down around line 104 which should be:

                        <td valign="top" class="main"><?php echo tep_break_string(nl2br(tep_output_string_protected($review['reviews_text'])), 60, '-<br>') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $review['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])) . '</i>'; ?></td>

remove the tep_output_string_protected function call from the line and see if that does not make a difference in the review text body.

 

The final line after editing should look like:

                        <td valign="top" class="main"><?php echo tep_break_string(nl2br($review['reviews_text']), 60, '-<br>') . '<br><br><i>' . sprintf(TEXT_REVIEW_RATING, tep_image(DIR_WS_IMAGES . 'stars_' . $review['reviews_rating'] . '.gif', sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])), sprintf(TEXT_OF_5_STARS, $review['reviews_rating'])) . '</i>'; ?></td>

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...