Who Can Use This Use Guide?
Developers
This book should serve as a thorough introduction for developers to the structure
of Magento, as well as provide you with enough examples that you can take any of
your coding ideas to fruition. Developers will learn how to write custom modules
for Magento for redistribution or for simply deploying on a corporate installation of
Magento.
Store Owners
If you are not a programmer, but simply want to run a Magento store, this book
might not be for you, but if you think you might need custom programming for your
shopping cart this book can help you communicate better with your developers.
It’s tough to avoid getting the wool pulled over your eyes when hiring a remote
developer. Armed with the knowledge ofMagento provided by this book, you should
be able to verify any cost estimates you receive and find out if your developers are
stalling or not.
About This Book
This book is organized roughly into two sections. The first section describes how
Magento works from a code perspective and from a general user-interface perspective.
The remaining chapters will walk the reader through building various modules
forMagento by example. Although not a complete detail ofMagento’s API, this book
should give the reader all the learning by examples that he or she should need to
understand all the concepts that driveMagento’s code.
Code Formatting
SinceMagento is built on the Zend Framework the code formatting of the examples
in this book will follow the Zend Framework style guidelines. Sometimes the code
examples in this book are shortened to fit on the pages, so style may suffer in some
instances to conserve space.
When referring to variables, classes, objects, or concepts this book will put the
word or words in question into italics. When specifically referring to the word of a
variable, class name, etc. the words will be formatted as inline code. File names will
also be formatted this way.
When talking about Mage_Core_Model_Abstract the object class italics will be
used, but when talking about why a class is named Mage_Core_Model_Abstract, inline
code formatting will be used.
XML Examples
When referencing XML the ellipses, …, are used to suggest that other, optional, or
pre-existing XML tags are present. Given the XML structure below:
<config>
<modules>
<Company_RewardPoints>
<version>0.1.0</version>
<depends>
<Mage_Customer />
<Mage_Checkout />
</depends>
</Company_RewardPoints>
</modules>
<global>
<resources>
<rewardpoints_setup>
<setup>
<module>Company_RewardPoints</module>
<class>Mage_Core_Model_Resource_Setup</class>
</setup>
<connection><use>core_setup</use></connection>
</resources>
</global>
</config>
The section enclosed in the rewardpoints_setup tag may be represented as this:
<config>
…
<global>
…
<resources>
<rewardpoints_setup>
<setup>
<module>Company_RewardPoints</module>
<class>Mage_Core_Model_Resource_Setup</class>
</setup>
<connection><use>core_setup</use></connection>
</resources>
…
</global>
…
</config>
Operating SystemConsiderations
When possible, this book will describe technical procedures for Linux,Mac OS X, and
Windows operating systems. However, to keep examples brief, simple references to
file locations will use Windows directory and file naming conventions. When listing
directories, the forward slash (/) will be used as a directory separator as this convention
falls in line with standard Unix behavior (Mac OS X and Linux) plus PHP and
Apache can automatically translate forward slashes to back slashes where need be
onWindows.
Do not be surprised to see a directory like this:
C:/xampp/apache/htdocs/magento/