I am new in Magento and I got below error on deleting product from admin panel.
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.
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'))));
}