} else {
    if ($product_id) {
        $reference->product_id = $product_id;
        $product = new CProduct();
        $product->load($product_id);
        $reference->_ref_product = $product;
    } else {
        if ($societe_id) {
            $reference->societe_id = $societe_id;
        }
    }
}
$reference->loadRefsFwd();
if (!$reference->_id) {
    $reference->quantity = 1;
    $reference->price = 0;
}
// Categories list
$category = new CProductCategory();
$list_categories = $category->loadList(null, 'name');
$lists = $reference->loadRefsObjects();
// Smarty template
$smarty = new CSmartyDP();
$smarty->assign('reference', $reference);
$smarty->assign('lists_objects', $lists);
$smarty->assign('list_categories', $list_categories);
$smarty->assign('filter', $filter);
$smarty->assign('keywords', $keywords);
$smarty->assign('letter', $letter);
$smarty->assign('show_all', $show_all);
$smarty->display('vw_idx_reference.tpl');