Book Image

Getting Started with Magento Extension Development

By : Branko Ajzele
Book Image

Getting Started with Magento Extension Development

By: Branko Ajzele

Overview of this book

Modules, are a group of php and xml files meant to extend the system with new functionality, or override core system behavior. Most of the base Magento system is built using the module system, so you can see why they are an important feature for this rich open-source e-commerce solutions. This book explores key module development techniques and teaches you to modify, understand and structure your modules making it easy for you to get a strong foundation for clean and unobtrusive Magento module development. Getting Started with Magento Extension Development is a practical, hands-on guide to building Magento modules from scratch. This book provides an in depth introduction and helps you discover features such as; blocks, controllers, models, configuration files, and other crucial elements which contribute to the Magento architecture. This book introduces the you to real-world modules and helps provide a strong foundation which you need to become a professional Magento module developer. The book further explores best practices and tips and tricks offering you the ultimate go to guide. Getting Started with Magento Extension Development focuses on three areas. First you are guided through the entire Magento structure, where each important directory or file is explored in detail. Then the essence of the module structure and development is explained through the detailed coverage of models, blocks, controllers, configuration, and other files that manifest a single module. Finally, a detailed set of instructions is given for building four real-world modules, including a payment and shipping module.
Table of Contents (13 chapters)
Getting Started with Magento Extension Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Registering your extension


The following are the steps for registering your extension so that Magento can see it:

  1. Prior to writing any real code, we first decide on a name for our extension. We will call it Foggyline_Cargo, and it will be placed under the community codePool.

  2. Once we settle on a name, we go ahead and define an extension registration file, app/etc/modules/Foggyline_Cargo.xml, with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <config>
        <modules>
            <Foggyline_Cargo>
                <active>true</active>
                <codePool>community</codePool>
                <depends>
                    <Mage_Shipping/>
                </depends>
            </Foggyline_Cargo>
        </modules>
    </config>

    Tip

    With the depends tag, Magento offers you the ability to load another extension before yours, as it establishes a load order (or error) for the extension config.xml.

  3. Once the file is in place, you need to...