Categories cannot be deleted (v. 2.94 Build 1 - 3)
This has been corrected in 2.94 Build 4.
In earlier releases, a category could not be deleted from the store admin area. To correct this, upgrade to the latest release, or:
-
Open the categories.php file in the /storeadmin/ folder.
-
Change the code:
if ($smode == "Yes, Delete Category" AND !empty($catid)) { $catid = (int)$catid; $oldparent = (int)$oldparent; // DELETE SUBS OR PROMOTE THEM? die("$oldparent - subprocess $subprocess - itemprocess $itemprocess"); // subprocess // UPDATE ITEMS for ($i=1; $i<=15; ++$i) { $itemresult = $dataconn->query("UPDATE " .SB_DB_PREFIX ."_items SET Category" .$i ."='$oldparent' WHERE Category" .$i ."='$catid'"); } $delcatquery = "DELETE FROM " .SB_DB_PREFIX ."_categories WHERE ID='$catid'"; $delcatresult = $dataconn->query($delcatquery); }to:
if ($smode == "Yes, Delete Category" AND !empty($catid)) { $catid = (int)$catid; // SUBCATEGORIES - MOVE TO ANOTHER CATEGORY OR MAKE MAIN $subprocess = (int)$subprocess; $subpromote = "UPDATE " .SB_DB_PREFIX ."_categories SET parent=$subprocess WHERE parent=$catid"; $subproresult = $dataconn->query($subpromote); // ITEMS IN CATEGORY - REMOVE ASSIGNMENT OR MOVE TO ANOTHER CATEGORY? $itemprocess = (int)$itemprocess; for ($i=1; $i<=15; ++$i) { $itempromote = "UPDATE " .SB_DB_PREFIX ."_items SET Category" .$i ."=$itemprocess WHERE Category" .$i ."=$catid"; $itemresult = $dataconn->query($itempromote); } // DELETE CATEGORY $delcatquery = "DELETE FROM " .SB_DB_PREFIX ."_categories WHERE ID='$catid'"; $delcatresult = $dataconn->query($delcatquery); } -
Change the code:
Do you want to continue?
"; echo ""; ?>Items: Move to parent Do not reassign
Subcategories: Promote to parent Deleteto:
Main level subcategories:
Products in this category:
Are you sure you want to permanently remove this category?
-
Save and reload the file.