How to add a link to view the review on the product page. If there is no review of the same product
1 answer
You can count the number of product reviews as follows:
$reviewCount = $_product->getRatingSummary()->getReviewsCount() ? $_product->getRatingSummary()->getReviewsCount(): 0;
if($reviewCount == 0){
//add write review link here
}
And write your anchor tag like this:
<a href="<?php echo Mage::getUrl('review/product/list', array('id'=> $_product->getId())); ?>#review-form" rel="nofollow"> <?php echo $this->__('Write Review') ?></a>
+6
source to share