You are here:  » Merge product page with reviews


Merge product page with reviews

Submitted by lecolet on Tue, 2012-09-04 15:45 in

Hi, David,

I would like to combine reviews page with the products page and I saw that you made a new products.php file for the standalone distribution. Is there a way to do it with the WP installation? And is there any easy way to add date and author to the reviews, so that it looks more like traditional reviews? Thanks.

Submitted by support on Wed, 2012-09-05 08:01

Hi,

Very easy to do with the plugin; in pto.php look for the following code at line 626:

$html .= pto_product(TRUE,TRUE,FALSE,$pto_config_useRelated);

...and REPLACE with:

$html .= pto_product(TRUE,TRUE,TRUE,$pto_config_useRelated);

And then in pto_common.php look for the following code at line 56:

return get_bloginfo('url').$pto_config_reviewBaseHREF.pto_common_hyphenate($product->normalised_name).".html";

...and REPLACE with:

return pto_common_productHREF($product);

Cheers,
David.
--
PriceTapestry.com

Submitted by lecolet on Fri, 2012-09-21 08:13

Thanks, David. I've tried to change it, but there is a problem with the price table. It shows only the link "buy". The product name, the merchant and the price don't show. Here is what I have in price-table configuration:

<div id="pto_prices_table">
<ul>
<li1>%MERCHANT%</li1>
<li2><a href='%BUY_URL%' target="_blank">%PRODUCT_NAME%</a></li2><li3>%PRICER%</li3><li4><a href='%BUY_URL%'>Buy</a></li4></ul>
</div>

I've tried replacing %PRODUCT_ NAME% with %DB_name% and the same with merchant, but they still don't show.

Submitted by support on Fri, 2012-09-21 08:50

Hi lecolet,

Could you possibly post a link to a page showing the problem - i'll remove the URL before publishing your reply and I'll check it out for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by lecolet on Fri, 2012-09-21 10:14

Here it is. And it's actually strange. On the product with the reviews I see the link "to buy":

{link saved}

But on the product with no reviews nothing shows:

{link saved}

Submitted by support on Fri, 2012-09-21 10:19

Thanks lecolet I see what's happend - code in the reviews section is overwriting the database variables used by the price comparison table. The easiest work-around is to swap the order and move the price comparison table above the reviews section - which may work better for your site anyway. To do this, open pto_product.php and look for the following code at line 413:

  if ($reviews)
  {
    $html .= pto_product_review($product);
  }
  if ($prices)
  {
    $html .= pto_product_prices();
  }

...and REPLACE with:

  if ($prices)
  {
    $html .= pto_product_prices();
  }
  if ($reviews)
  {
    $html .= pto_product_review($product);
  }

That should do the trick!

Cheers,
David.
--
PriceTapestry.com

Submitted by lecolet on Fri, 2012-09-21 10:38

Thank you! That's perfect!