本文整理汇总了PHP中ps_product::recentProducts方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_product::recentProducts方法的具体用法?PHP ps_product::recentProducts怎么用?PHP ps_product::recentProducts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ps_product
的用法示例。
在下文中一共展示了ps_product::recentProducts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: krsort
$products[$i]['product_in_stock'] = $db_browse->f("product_in_stock");
$products[$i]['product_available_date'] = $VM_LANG->convert(vmFormatDate($db_browse->f("product_available_date"), $VM_LANG->_('DATE_FORMAT_LC')));
$products[$i]['product_availability'] = $db_browse->f("product_availability");
$products[$i]['cdate'] = $VM_LANG->convert(vmFormatDate($db_browse->f("cdate"), $VM_LANG->_('DATE_FORMAT_LC')));
$products[$i]['mdate'] = $VM_LANG->convert(vmFormatDate($db_browse->f("mdate"), $VM_LANG->_('DATE_FORMAT_LC')));
$products[$i]['product_url'] = $db_browse->f("product_url");
}
// END OF while loop
// Need to re-order here, because the browse query doesn't fetch discounts
if ($orderby == 'product_price') {
if ($DescOrderBy == "DESC") {
// using krsort when the Array must be sorted reverse (Descending Order)
krsort($products, SORT_NUMERIC);
} else {
// using ksort when the Array must be sorted in ascending order
ksort($products, SORT_NUMERIC);
}
}
$tpl->set('products', $products);
$tpl->set('search_string', $search_string);
if ($num_rows > 1) {
$browsepage_footer = $tpl->fetch('browse/includes/browse_pagenav.tpl.php');
$tpl->set('browsepage_footer', $browsepage_footer);
} else {
$tpl->set('browsepage_footer', '');
}
$recent_products = $ps_product->recentProducts(null, $tpl->get_cfg('showRecent', 5));
$tpl->set('recent_products', $recent_products);
$tpl->set('ps_product', $ps_product);
echo $tpl->fetch($tpl->config->get('productListStyle'));
}