zencart只有购买过此产品的客户才能评价产品
当前登录的客户买过此产品时,才显示评价按钮:
<?php $rev_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'] . "'" ; $rev = $db->Execute($rev_query); if ($rev->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 } ?>
转载请注明出处!小鱼阁工作室 -专注zencart建站,织梦企业建站,ecshop商城,二次开发,产品采集,模板修改!技术QQ 631992791