To Remove the Product from all Categories and Move it to the Sold Out Category and fix the master_categories_id to the Sold Out Category ...
Assume we are using categories_id 70 for the Sold Out Category ... you will have to change that to match yours ...
Edit the file:
/includes/classes/order.php
and change the code to include the code in red:
Code:
if ($stock_left <= 0) {
// bof: move Product to Sold Out Category categories_id 70
// remove Product from all categories
$db->Execute("DELETE from " . TABLE_PRODUCTS_TO_CATEGORIES . " WHERE products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
// add Product to Sold Out Category categories_id 70
$db->Execute("INSERT into " . TABLE_PRODUCTS_TO_CATEGORIES . "
(products_id, categories_id)
values (" . (int)zen_get_prid($this->products[$i]['id']) . ", 70)");
// update master_categories_id to be Sold Out Category 70
$db->Execute("UPDATE " . TABLE_PRODUCTS . " SET master_categories_id = 70 WHERE products_id = '" . zen_get_prid($this->products[$i]['id']) . "'");
// eof: move Product to Sold Out Category categories_id
// 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']) . "'");
}
}
Make sure that in the Configuration ... Stock ... that the setting for the Product Status on Sold Out is set to 1:
Products status in Catalog when out of stock should be set to
Show Products when out of stock
0= set product status to OFF
1= leave product status ON
Bookmarks