Hiding products when stock is zero

Bug

It should be rather simple, if you add small piece of code to the line that manages how the items are called for the overview page you can exclude the products that are out of stock

Somewhere around line 70 of the view_overview page change:

// Query items (for this page)
$query_items = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_bakery_items WHERE section_id = '$section_id' AND active = '1' AND title != '' ORDER BY position ASC".$limit_sql);
$num_items = $query_items->numRows();


into somthing like:


// Query items (for this page)
$query_items = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_showroom_items WHERE section_id = '$section_id' AND active = '1' AND stock > '0' AND title != '' ORDER BY position ASC".$limit_sql);
$num_items = $query_items->numRows();





erikp01

Is it possible to hide the products when stock is zero?