3
You would have to hack 3 files to do this the right way but, maybe you can go directly to the source without secondary effects.
Try edit class/oledrion_products.php and add this:
function getMostViewedProducts($start = 0, $limit = 0, $category = 0, $sort = 'product_hits', $order = 'DESC')
{
$tbl_datas = array();
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('product_online', 1, '='));
if(oledrion_utils::getModuleOption('show_unpublished') == 0) { // Ne pas afficher les produits qui ne sont pas publiés
$criteria->add(new Criteria('product_submitted', time(), '<='));
}
if(oledrion_utils::getModuleOption('nostock_display') == 0) { // Se limiter aux seuls produits encore en stock
$criteria->add(new Criteria('product_stock', 0, '>'));
}
if(is_array($category)) {
$criteria->add(new Criteria('product_cid', '('.implode(',',$category).')', 'IN'));
} elseif($category != 0) {
$criteria->add(new Criteria('product_cid', intval($category), '='));
}
$criteria->add(new Criteria('product_hits', 0, '>'));
//add this line
$criteria->add(new Criteria('product_submitted', time()-7*24*60*60, '>='));
//end
$criteria->setLimit($limit);
$criteria->setStart($start);
$criteria->setSort($sort);
$criteria->setOrder($order);
$tbl_datas = $this->getObjects($criteria, true);
return $tbl_datas;
}