Building Magento extensions can be a challenging task for several reasons. On one side a developer is required to have a solid understanding of advanced PHP object-oriented knowledge, while on the other side there are numerous Magento-specific patterns and configuration options you need to master. This book will give you enough insight into the structure and concepts, and teach you a few tricks that will help you master Magento more easily. By the end of the book, you should familiarize yourself with configuration files, models, blocks, controllers, event/observers, shipping, and payment methods. All of these should form a solid foundation for your developing modules later.
Chapter 1, An Overview of Magento Extensions, introduces you to the overall Magento directory structure, digging all the way down to the individual module structure. Important concepts such as Block, Model, Helper, and controller classes together with configuration files are introduced and explained.
Chapter 2, Building the Extension – Maximum Order Amount, guides you through your first real-world module. Using the event/observer system, you build a simple but powerful module for limiting the amount of maximum purchase.
Chapter 3, Building the Extension – Logger, introduces you to the practical usage of models and installation scripts in Magento, together with the use of administration grids for displaying the entity data.
Chapter 4, Building the Extension – Shipping, introduces you to the Magento shipping methods system, showing you a practical example for building your own shipping method.
Chapter 5, Building the Extension – Payment, introduces you to the Magento payment methods system, showing you a practical example for building your own payment method.
Chapter 6, Packaging and Publishing Your Extension, introduces you to the process of packaging your extension for distribution over the Magento Connect extension marketplace.
In order to successfully run all the examples provided in this book, you will need either your own web server or third-party web hosting solution. The Magento Community Edition platform itself comes with a detailed list of system requirements, which you can find at http://www.magentocommerce.com/system-requirements. If you are able to install Magento on your server, you should be able to follow all the guidelines given in the book.
This book is primarily intended for intermediate to advanced PHP developers looking for a way into Magento module development. The existing Magento developers might find certain chapters interesting as well, depending on their previous experience.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "This is basically a
.htaccess template file used for creating new stores within subfolders."
A block of code is set as follows:
<?xml version="1.0"?> <config> <modules> <Foggyline_HappyHour> <active>true</active> <codePool>community</codePool> </Foggyline_HappyHour> </modules> </config>
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "You can confirm that by going under the Magento administration under System | Configuration | Advanced | Advanced | Disable Modules Output."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to
<[email protected]>, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at
<[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at
<[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.