Related cards:
Add A Tab To The Admin Product Screen
Declare an admin layout XML file for your module in your config.xml
:
<config>
<adminhtml>
<layout>
<updates>
<your_module>
<file>your-module.xml</file>
...
Add A Tab To The Admin Product Screen
Adding A Tab To The Product Screen
-
Declare an admin layout XML file for your module in your config.xml:
Config Layout Definition (Frontend & Admin)
Frontend:
<config>
<frontend>
<layout>
<updates>
<namespace_module>
<file>namespace-module.xml</file>
</namespace_module>
</up...
Config Controller Definition (Frontend & Admin)
Frontend With Route:
<config>
<frontend>
<routers>
<namespace_module>
<use>standard</use>
<args>
<module>Namespace_Module</module>
...
Admin Grids - Filtering A Joined Column
Often, you'll want to add a column to a collection used in a grid, and to do so you'd use _prepareCollection()
:
protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());
...
Table Creation In Magento 1.6/1.11+
Magento CE 1.6 and PE/EE 1.11 introduced database abstraction, this is the way to set up tables using the new code.
$table = $installer->getConnection()
->newTable($installer->getTable('your_module/table_name_in_xml'))
->...
EAV Tables
A list of EAV tables and their purpose.
|----------------------------+-------------------------------------------------------------------------------------|
| Table | Contains ...
Boilerplate Admin Controller
/**
* Yourcompany.com
*
* PHP Version 5
*
* @category Namespace
* @package Namespace_Module
* @author Your Name <your.name@yourcompany.com>
* @copyright 2012 yourcompany.com
* @license http:...
Layout Loading and Misc Notes
Layout XML files are loaded here via this stack - here we are loading the layout update for the rwd/default design package, for the CMS home page. I've put a dashed line on the demarcation between layout code and other code:
Mage_Core_Model_A...
Config Event Observer Definition (Frontend, Admin & Global)
Frontend:
<config>
<frontend>
<events>
<the_name_of_the_event_to_observe>
<observers>
<namespace_module>
<class>namespace_module/obser...