1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| function buildProductReviewsPerPagination($reviews, $limit, $page)
{ global $settings, $prodId;
$html = '';
$html .= '<div id="reviews">';
foreach($reviews as $review){
$date=date_create($review['created']);
$reviewDate = date_format($date,"d M, Y");
$html .= '<ul class="reviews">';
$html .= '<li>';
$html .= '<div class="review-heading">';
$html .= "<h5 class='name'>".$review['username']."</h5>";
$html .= "<p class='date'>".$reviewDate."</p>";
$html .= '<div class="review-rating">';
for ($i = 1; $i <= 5; $i++) {
$ratingClass = "fa-star-o";
if($i <= $review['ratingNumber']) {
$ratingClass = "fa-star";
}
$html .= "<i class='fa ".$ratingClass."'></i>";
}
$html .= '</div>';
$html .= '</div>';
$html .= '<div class="review-body">';
$html .= "<p>".$review['comments']."</p>";
$html .= '</div>';
$html .= '</li>';
$html .= '</ul>';
}
//init and call pagination nav at bottom
$ver = $settings['url']."ibuy_e-commerce/product/?action=product-details&id=${review['product_id']}&page";
if(reviews_pagination($reviews, $prodId, $ver, $limit, $page)) {
$html .= "".reviews_pagination($reviews, $prodId, $ver, $limit, $page)."";
}
$html .= '</div>';
return $html;
} |
Partager