You are here:  » displaying reviews on product pages


displaying reviews on product pages

Submitted by speak2daryl on Mon, 2009-12-21 19:10 in

Hi,

On the my old installation of price tapestry installed a modified products.php to display reviews on the product pages.

Since installing the new price tapestry software I can not get the modification to work.

Would you be able to provide me with a new products.php that would show reviews on the product page that would work with the new version of price tapestry.

Thanks

Daryl

Submitted by support on Mon, 2009-12-21 19:24

Hi Daryl,

Sure - i'll email it over to you now...

Cheers,
David.

Submitted by rsachoc on Sat, 2010-06-05 18:31

David, I would also like to implement this, I'm running the new PT, could you post/email me the updated product.php when you get a spare moment?

Thanks

Submitted by jonny5 on Mon, 2010-10-11 16:16

any chance u could post the code here that i need to add to the product page

i did try just including the ratings.php but no use

Submitted by support on Tue, 2010-10-12 08:13

Hi Jonny,

You also need to merge in the form handler code, which begins at line 8 of reviews.php:

  if (isset($_POST["submit"]))

(merge into the same place in products.php)

...and then copy the following section beginning at line 61:

      $sql = "SELECT * FROM `".$config_databaseTablePrefix."reviews` WHERE product_name = '".database_safe($q)."' AND approved <> '0' ORDER BY created";
      if (database_querySelect($sql,$rows))
      {
        $ratings["reviews"] = $rows;
      }

...and paste that into products.php immediately after the following code at line 48:

      $product["products"] = $rows;

Cheers,
David.
--
PriceTapestry.com

Submitted by jonny5 on Tue, 2010-10-12 16:23

wasnt quite sure what u meant here , merge it where??

You also need to merge in the form handler code, which begins at line 8 of reviews.php:

if (isset($_POST["submit"]))

Submitted by support on Wed, 2010-10-13 07:54

Hi Jonny,

If you would like to email me your products.php and reviews.php I'll merge them for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Retro135 on Sat, 2017-07-01 03:55

Does this code also work for 15/09?

Submitted by support on Sat, 2017-07-01 08:47

Hi,

Yes, all current but you probably want to update the tapestry_reviewHREF() function in includes/tapestry.php beginning at line 74:

  function tapestry_reviewHREF($product)
  {
    global $config_baseHREF;
    global $config_useRewrite;
    if ($config_useRewrite)
    {
      return $config_baseHREF."review/".urlencode(tapestry_hyphenate($product["normalised_name"])).".html";
    }
    else
    {
      return $config_baseHREF."reviews.php?q=".urlencode($product["normalised_name"]);
    }
  }

...REPLACE with just:

  function tapestry_reviewHREF($product)
  {
    return tapestry_productHREF($product);
  }

(i'll follow up to your other post re: InnoDB by email...)

Cheers,
David.
--
PriceTapestry.com