When I change the status of brands in the leftpanel extension I get this error and it doesnt change the status Line 180 is this code ->load($leftpanelId)
Fatal error: Call to a member function load() on a non-object in /home/thebeau9/public_html/app/code/local/Nextgeni/Leftpanel/controllers/Adminhtml/BrandsController.php on line 180
public function massStatusAction()
{
$leftpanelIds = $this->getRequest()->getParam('leftpanel');
if(!is_array($leftpanelIds)) {
Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
} else {
try {
foreach ($leftpanelIds as $leftpanelId) {
$leftpanel = Mage::getSingleton('leftpanel/leftpanel')
->load($leftpanelId)
->setStatus($this->getRequest()->getParam('status'))
->setIsMassupdate(true)
->save();
}
$this->_getSession()->addSuccess(
$this->__('Total of %d record(s) were successfully updated', count($leftpanelIds))
);
} catch (Exception $e) {
$this->_getSession()->addError($e->getMessage());
}
}
$this->_redirect('*/*/index');
}
Config.xml
<global>
<models>
<leftpanel>
<class>Nextgeni_Leftpanel_Model</class>
<resourceModel>leftpanel_mysql4</resourceModel>
</leftpanel>
<leftpanel_mysql4>
<class>Nextgeni_Leftpanel_Model_Mysql4</class>
<entities>
<brand>
<table>leftpanel_brand</table>
</brand>
<treatment>
<table>leftpanel_treatment</table>
</treatment>
<ingredient>
<table>leftpanel_ingredient</table>
</ingredient>
</entities>
</leftpanel_mysql4>
<!-- Paypal config model override - Gk on 03-08-2015 -->
<paypal>
<rewrite>
<!-- Model -->
<config>Nextgeni_Leftpanel_Model_Config</config>
</rewrite>
</paypal>
<!-- Paypal config model override - Gk on 19-08-2015 -->
<paypal>
leftpanel.php in model
class Nextgeni_Leftpanel_Block_Leftpanel extends Mage_Core_Block_Template
{
public function _prepareLayout()
{
return parent::_prepareLayout();
}
public function getLeftpanel()
{
if (!$this->hasData('leftpanel')) {
$this->setData('leftpanel', Mage::registry('leftpanel'));
}
return $this->getData('leftpanel');
}
}
Brand.php in model
<?php
class Nextgeni_Leftpanel_Model_Brand extends Mage_Core_Model_Abstract
{
public function _construct()
{
parent::_construct();
$this->_init('leftpanel/brand');
}
}
app/code/local/Nextgeni/Leftpanel/etc/config.xml
?app/code/local/Nextgeni/Leftpanel/Model/Leftpanel.php
?