public function send_comment() { $comment = new fpp_product_rate_Model(); $comment_product = $comment->db2cls(); $savedb = array('product_id' => $_POST['product_id'], 'user_id' => $_SESSION['conf']['client']['id'], 'comment' => $_POST['product_comment'], 'rate' => $_POST['rate'], 'status' => 'pending'); $comment_product->set_fields($savedb); $comment_product->save(); return true; }
<?php } ?> <?php if (count($product_comments) > 0) { ?> <div class="title"><?php __("Comentario de nuestros clientes"); ?> </div> <div id="product-comment-container"> <?php foreach ($product_comments as $product_comment) { ?> <?php $fpcm = new fpp_product_rate_Model(); $orm = $fpcm->db2cls(); $pr = $orm->fetch_where(array('product_id' => $product->id_product, 'user_id' => $product_comment->id_client)); if (count($pr) > 0) { foreach ($pr as $r) { $user_product_rate = $r->rate; } } else { $user_product_rate = 0; } ?> <div class='product-rate-comment'> <p><?php echo $product_comment->comment; ?> </p>