本文整理匯總了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'));
}