Post #1
5 November 2014, 20:41
|
Prestashop 1.6 страница с отзывами
Создать файл list.php в директории /modules/productcomments/. В файл добавить:
Создать файл comments.tpl в директории /modules/productcomments/. В файл добавить:
<?php
require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../header.php');
include_once(dirname(__FILE__).'/productcomments.php');
$context = Context::getContext();
$comments = new ProductComments();
require_once(dirname(__FILE__).'/ProductComment.php');
$context->smarty->assign('comments', ProductComment::getAll());
echo $context->smarty->display(dirname(__FILE__).'/comments.tpl');
require(dirname(__FILE__).'/../../footer.php');
Создать файл comments.tpl в директории /modules/productcomments/. В файл добавить:
<div>
{if $comments}
{foreach from=$comments item=comment}
<div class="comment clearfix">
<div class="comment_author">
<div class="comment_author_infos">
<strong>{$comment.customer_name|escape:'html':'UTF-8'}</strong>
<em>{dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0}</em>
</div>
</div>
<div class="comment_details">
<h4 class="title_block">{$comment.name}</h4>
<p>{$comment.content|escape:'html':'UTF-8'|nl2br}</p>
</div>
</div>
{/foreach}
{/if}
</div>
Last edit
admin
-
05 November 2014, 20:42
0
{dateFormat date=$comment.date_add|escape:'html':'UTF-8' full=0}
{$comment.name}
{$comment.content|escape:'html':'UTF-8'|nl2br}