Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / how to make customers only can write a review on the products he or she bought?

how to make customers only can write a review on the products he or she bought?

Started by win8win on 25 Jun 2012, 1:46 PM · Views: 859

Results 1 to 3 of 3
25 Jun 2012, 1:46 PM
#1
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Post #1 by win8win

how to make customers only can write a review on the products he or she bought?

focus on the open source for online shoping website.
my site: best shop 24h.com

26 Jun 2012, 9:44 AM
#2
jacxie avatar

jacxie

New Zenner

Join Date:
Jun 2012
Posts:
4
Plugin Contributions:
0

Post #2 by jacxie

if the products is very good or very bad!!!!

2 Jul 2012, 12:22 PM
#3
win8win avatar

win8win

Zen Follower

Join Date:
Apr 2012
Location:
beijing
Posts:
258
Plugin Contributions:
1

Post #3 by win8win

figured out,
add a if before show the "write a review" button

//if the customer bought the product before,show the “write a review button”,else donot show;
$reviews2_query = “select count(*) as count from orders o ,orders_products op” .”
where op.products_id = ‘” . (int)$_GET['products_id'] . “‘
and o.orders_id=op.orders_id
and o.customers_id = ‘” . (int)$_SESSION['customer_id'] . “‘” ;
$reviews2 = $db->Execute($reviews2_query);
//echo $reviews2->fields['count'].”b##”;
if ($reviews2->fields['count']>0)
{
?>

<div id=”productReviewLink” class=”buttonRow back”><?php echo ‘<a href=”‘ . zen_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, zen_get_all_get_params(array())) . ‘”>’ . zen_image_button(BUTTON_IMAGE_WRITE_REVIEW, BUTTON_WRITE_REVIEW_ALT) . ‘</a>’; ?></div> <br class=”clearBoth” /> <?php }

focus on the open source for online shoping website.
my site: best shop 24h.com