You could try this, after backing up your database and the file orders.php, by adding the code in RED:
/includes/classes/order.php
Code:
// if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
if ($stock_left <= 0) {
// bof: move Product to Sold Out Categories
$categories_sold_out = 66; // Set to Sold Out categories_id
$delete_sql = "DELETE from " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id ='" . zen_get_prid($this->products[$i]['id']) . "'";
$db->Execute($delete_sql);
$add_sql = "INSERT INTO " . TABLE_PRODUCTS_TO_CATEGORIES . "(products_id, categories_id) values (" . zen_get_prid($this->products[$i]['id']) . ", " . $categories_sold_out . ")";
$db->Execute($add_sql);
$update_sql = "UPDATE " . TABLE_PRODUCTS . " SET master_categories_id = " . $categories_sold_out . " WHERE products_id = '" . zen_get_prid($this->products[$i]['id']) . "'";
$db->Execute($update_sql);
// eof: move Product to Sold Out Categories
// only set status to off when not displaying sold out
if (SHOW_PRODUCTS_SOLD_OUT == '0') {
$db->Execute("update " . TABLE_PRODUCTS . " set products_status = 0 where products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
}
Be sure to first Create your Sold Out Category and then edit this code and use that categories_id for this setting where it is set currently to 66 to your own categories_id:
Code:
$categories_sold_out = 66; // Set to Sold Out categories_id