Node is saved as draft in My Content >> Draft
-
Delete Category and Products by ids in magento Programming
Delete category and Products By Ids in Magento by following the steps:
1 - Deleting Category:
send category id with Query String to controller such as

Then write the controller as
public function deletcatAction(){
Mage::register('isSecureArea', 1);
$categoryId = $_REQUEST['id'];
$category = Mage::getModel('catalog/category')->load($categoryId);
try{
$category->delete();
}
catch (Exception $e){
echo $e->getMessage();
}
}
Deleting Products:
send category id with Query String to controller such as

Then write the controller as
public function deletprdctAction(){
Mage::register('isSecureArea', 1);
$productId = $_REQUEST['id'];
$product = Mage::getModel('catalog/product')->load($productId);
try{
$product->delete();
$this->_redirect('manager/account/dashboardedit');
}
catch (Exception $e){
echo $e->getMessage();
}
}
0 Comment(s)