How to find controller path in Magento 1.9?

1.5k views Asked by At

I am new in Magento and I got below error on deleting product from admin panel.

Error

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'website_id' cannot be null

And I have to trace that path of delete product controller, so that I can fix that error. Can any one please tell me the right path to it?

This is the URL when I hit the delete button from admin panel

http://my_path/index.php/admin/admin/catalog_product/delete/id/5646/

I tried debugging by enabling hints from database.

1

There are 1 answers

0
Klaus Mikaelson On

Go to app\code\core\Mage\Adminhtml\controllers\Catalog\ProductController.php

In this file you will see

public function deleteAction()
{echo "Here is product delete action!";die;
    if ($id = $this->getRequest()->getParam('id')) {
        $product = Mage::getModel('catalog/product')
            ->load($id);
        $sku = $product->getSku();
        try {
            $product->delete();
            $this->_getSession()->addSuccess($this->__('The product has been deleted.'));
        } catch (Exception $e) {
            $this->_getSession()->addError($e->getMessage());
        }
    }
    $this->getResponse()
        ->setRedirect($this->getUrl('*/*/', array('store'=>$this->getRequest()->getParam('store'))));
}