I f customers turn a product to 'out stock' status. his product is supposed to can not be seen anywhere if the status of '$include_deactivated' is false which is false in default. But there is a bug. I can see the products that i set to out stock. I researched the source code. And finally i found the reason.
in YOUR_STORE_DOMAIN/includes/functions/functions_categories.php.
go to function 'zen_get_categories_products_list'.
Change the following line
$sql = "select p.products_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p2c.categories_id = '" . (int)$childCatID . "'" .
($include_deactivated ? " and p.products_status = 1" : "") .
$display_limit;
to:
$sql = "select p.products_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p2c.categories_id = '" . (int)$childCatID . "'" .
($include_deactivated ? "" : " and p.products_status = 1") .
$display_limit;
It might be a tiny logic mistake.
Bookmarks