{foreach $products as $item name=product}
<h2><a href="/list/post/{$item['id']}/">{$item['product']}</a></h2>
{foreach $comment as $itemcom}
{if $itemcom['product_id'] == $item['id']}
<p>{$itemcom['content']}</p>
{/if}
{foreachelse}
<div id="blockNewComment">
<form
...
</form>
</div>
{/foreach}
{/foreach}
$products и $comment берутся из контроллера:
// Получение списка данных
$products = getAllProducts();
$userID = isset($_SESSION['user']) ? $_SESSION['user']['id'] : null;
$comment = getComment($userID);
$smarty->assign('products', $products);
$smarty->assign('comment', $comment);