Zen Cart 1.3.5
I found a problem with the products_new time limit.
There is an admin setting "New Product Listing - Limited to" (under max values). And I think this is meant to limit the products_new output.
But it does not seem to work, and if I look in the header_php.php file for the products_new page it shows:
Code:
//$display_limit = zen_get_products_new_timelimit();
$display_limit = zen_get_new_date_range();
So it looks like is was changed to use zen_get_new_date_range() (or that someone was preparing to make it use zen_get_products_new_timelimit()).
A look at zen_get_new_date_range() shows:
Code:
// build date range for new products
function zen_get_new_date_range($time_limit = false) {
if ($time_limit == false) {
$time_limit = SHOW_NEW_PRODUCTS_LIMIT;
}
// 120 days; 24 hours; 60 mins; 60secs
$date_range = time() - ($time_limit * 24 * 60 * 60);
// echo 'Now: '. date('Y-m-d') ."<br />";
// echo $time_limit . ' Days: '. date('Ymd', $date_range) ."<br />";
$zc_new_date = date('Ymd', $date_range);
$new_range = ' and p.products_date_added >=' . $zc_new_date;
return "";
return $new_range;
}
This confirms that the formentioned admin setting indeed is meant to set the limit:
Code:
$time_limit = SHOW_NEW_PRODUCTS_LIMIT;
But just before the actual value is returned another return is executed:
Which causes the function to return an empty string of course (and products_new shows all products).
I am not sure what the intention was, but if I comment out the return, or if I change header_php.php to use zen_get_products_new_timelimit(), it is possible to set the products_new time range again from admin.