View Single Post
  #1  
Old 11-02-2003, 07:33 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default Mod: Display number of reviews

I was looking to find a way to display the number of reviews and reached this post: http://forum.x-cart.com/viewtopic.php?t=2292 - which shows how to display the number of votes

Taking off from this idea I made the following mod:

In customer/vote.php add the following code:

Code:
################### //display total reviews $reviews_result = func_query_first ("SELECT COUNT(remote_ip) as total FROM $sql_tbl[product_reviews] WHERE productid='$productid'"); if ($reviews_result["total"] == 0) $smarty->assign ("reviews_result", $reviews_result); $smarty->assign ("reviews_total", $reviews_result["total"]); ###################

and then in skin1/customer/Modules/Customer_Reviews/reviews.tpl add the following code where you want to display the number:

Code:
{$reviews_total}


Personally I placed it here:
Code:
{$reviews_total} {$lng.lbl_customer_reviews}

This shows something like "11 Customer Reviews"

Neat !


Next I'd like to limit the number of reviews shown to 5 and then "click here to display all"
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote