How to delete category from frontend in magento?

Posted: January 5, 2013 in Magento, Version 1.3.*, Version 1.4.*, Version 1.6.*

Hello,

Below code will delete particular category in magento.


 require_once realpath(dirname(__FILE__).'/app/Mage.php';
 Mage::app('default'); // Default or your store view name.
 Mage::register('isSecureArea', 1);// This will set secure area as admin
 $category = Mage::getModel('catalog/category')->load(15);//Here 15 is category id & it create category object
 $category->delete(); // This code will delete category whose id is 15

I hope above content is useful to you. Thanks for reading my blog.

Thanks,
Bijal Bhavsar:)

Advertisements
Comments
  1. Really nice post, highly instructive and properly written.. Good Profession

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s