cancel
Showing results for 
Search instead for 
Did you mean: 

if($review): .... but what if no review?

if($review): .... but what if no review?

I am working on one of the pages and there is code to display the review summary if there is a review. What I want to do is show something if there is NO review. Maybe the grayed out stars?

 

Can someone help me with this?

 

<?php if($review): ?>
<?php echo $this->getReviewSummaryHtml($_product) ?>

<?php endif; ?>

Thanks!

3 REPLIES

Re: if($review): .... but what if no review?

<?php if(!$review): ?>
      /* Do something */
<?php endif; ?>
Brian Wade
President / Senior Developer Cybersolutions LLC - LinkedIn Profile

Re: if($review): .... but what if no review?

<?php if($review): ?>
    <?php echo $this->getReviewSummaryHtml($_product) ?>
<?php else: ?>
// display grayed out stars <?php endif; ?>

Re: if($review): .... but what if no review?

Putting the else statement always gave me an error on the page, not sure why. It seems as though it's a simple add-in, but nothing seems to work for me.