Show Menu
Cheatography

Magento Modules - Beginners Cheat Sheet (DRAFT) by

Cheat Sheet for creating a magento module. (for absolute beginners)

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Magento Module Files

/app/c­ode­/lo­cal­/Na­meS­pac­e/M­odu­leName
Rootfolder of your module
etc/
Folder to store config
etc/co­nfi­g.xml
There you can define basic config like its version and evento­bse­rvers

etc/co­nfi­g.xml

/config/
module­s/N­ame­Spa­ce_­Mod­ule­Nam­e/v­ersion
version of your module
global­/events
here you can select an observer
global­/ev­ent­s/E­ven­tOb­ser­ver­/ob­ser­ver­s/n­ame­spa­ce_­mod­elname/
class
the model to instan­tiate (names­pac­e_m­ode­lna­me/­obs­erver)
method
method that will be called
type
e.g. singleton
global­/models
here comes youre models
global­/mo­del­s/n­ame­spa­ce_­mod­elname
global­/mo­del­s/n­ame­spa­ce_­mod­eln­ame­/class
= NameSp­ace­_Mo­del­Nam­e_Model

Activating Module

file
app/et­c/m­odu­les­/Na­meS­pac­e_M­odu­leN­ame.xml
xml-st­ructure active
/confi­g/m­odu­les­/Na­meS­pac­e_M­odu­leN­ame­/active = true
xml-st­ructure code-pool
/confi­g/m­odu­les­/Na­meS­pac­e_M­odu­leN­ame­/co­dePool = local