Magento 1.3: PHP Developers Guide

Chapter 1: Magento PHP Developer's Guide. 7. Extending Magento. 8. Core development functionality coverage. 8. Core principles of development. 9.
Table of contents

Errata 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 to improve subsequent versions of this book. If you find any errata, please report them by visiting http: Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata.

Any existing errata can be viewed by selecting your title from http: 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 web site name immediately so that we can pursue a remedy.

Magento 1.3: Php Developer's Guide

We appreciate your help in protecting our authors, and our ability to bring you valuable content. PHP Developer's Guide is a book for those developers who want to work with the Magento e-commerce platform. In this book, we will be guided through the fundamentals of development with Magento. If we're either frustrated with the "give you all the code" tutorials and articles online or actually really prefer them then, we'll find comfort in the code examples given in this book.

Each code block in the book is followed by a detailed piece-by-piece explanation of what each part of the code does. This way, we can get information about not just the functionality, but also learn about the inner workings of the code being implemented. Practical knowledge focused on common requirements of any Magento development is gained in this book, in both the day-to-day environment, as well as casual pick-it-up-when-you-need-it situations.

This book will add to our development knowledge, once we go through it thoroughly. We will learn the following: Providing an extremely solid base for development. The ability to solve frequently occurring issues. We'll learn to build payment and shipping modules. These can be broken down into the following: With each of these methods for extending Magento, we'll go through how existing modules within Magento do it and how we can too, building real-world examples as we go along.

Practical examples will be used and explained block by block as we go along. Every piece of code is run through to start, allowing us to skim through the chapters when we need the code in a hurry. It is also then backtracked over to ensure that proper understanding and meaningful explanation is given to every block that is placed into our modules or scripts.

This ensures that no function is unknown, once the code it written. We'll extend Magento throughout this book, without touching any of the core files in the installation. This means that the methods taught in this book and those used throughout this book, will not affect the core installation of Magento. When upgrading, we won't need to worry about module malfunctioning. Core development functionality coverage In this book, we will cover several topics that we encounter when programming with Magento.

These vary from functionality you will touch upon in every single site you build or maintain that is using Magento to functionality that will be touched upon not quite so much, but is equally as important to be aware of when developing with Magento. System maintenance Important factors such as upgrading Magento and installed modules, backing up internal system data, and fixing commonly occurring issues will be covered in this book. Payment and shipping module development We'll learn how to build both payment and shipping modules while reading this book.

These will expand upon Magento's base and provide additional functionality. Module development We will build several modules in this book, from basic modules that bring additional features to Magento, to fully featured extensions that manage data in the backend of Magento, as well as having dynamic frontends and their own dedicated URL structure for display. Data portability and interaction Probably the biggest factor in choosing any content management system has to, be whether or not we can get the data in or out of the system.

Whether or not it will integrate with our existing systems is also a large concern. In this book, we'll cover mass importing and updating of data via Excel documents and the built-in Core API. These will allow integration with existing backend or internal systems. We'll also cover how to integrate Magento with third-party content management systems. Chapter overview The chapters in this book vary greatly in terms of what they teach, to ensure that as many topics are covered as possible. This ensures that in depth knowledge of development is gained from them. Installing, upgrading, and preparing for development We'll start by walking through the server requirements for installing Magento and proceed onto how to check manually and how to check automatically using a prepared script that Magento provides for you to check hosting environments prior to installing Magento on them.

Installing Magento manually will be covered step by step, from downloading Magento to uploading the contents of the zip file to our server and going through the installation right to the end. Upgrading will then be covered to ensure that Magento installations are kept up to date with the latest updates released by Varien. We'll walk through how to perform both these actions through a Secure Shell connection to be able to use your root server access to speed up the upgrade and installation process as well as automate it.


  • Bilder schreiben: Virtuose Ekphrasis in Philostrats Eikones: Virtuose Ekphrasis in Philostrats Eikon!
  • My Life On A Narrowboat - Lines From The Lock & waterway Wishes;
  • See a Problem?!
  • Book Details;

SVN Subversion users will be able to keep the installation updated using Magento's repository. Overall, this chapter will make sure Magneto's installation and upgrade process can fit into our workflow and suit our hosting environment setup. System architecture In this chapter we'll run through the architecture behind Magento's system, covering the core file structure and through to how the template system works. This will be important to understanding Magento as a whole and placing our files in the right place when beginning development.

getHelloworld(); ?>

It will help break down the barriers between approaching Magento for the first time and developing your first project that plague most developers. We'll learn more about the Zend Framework and how it powers Magento's core architecture. This will be explained for a better understanding of Magento's structure. We'll also go through the best methods for backing up data within Magento, to make sure you're covered before doing anything drastic with your installation and that any data is safe from loss going forward.

In this chapter, we'll be learning how to build a basic shipping module for Magento that will form a module skeleton of functions which can be used in further development of shipping modules. We'll go through what other shipping modules have done and what's possible when building shipping modules for Magento. Proceeding from there, we'll build a basic shipping module with a few methods applied to it, which will put what we've learned into practice.

Payment modules Payment modules are vital in Magento, and we'll walk through how to build a basic skeleton of a payment module, in the payment module chapter. From this, we'll learn how they are structured and how to build the base before advancing ahead to something better. We'll learn how to add basic events to our payment module to advance it towards a fuller integration than expected from a basic module.

Basic module creation and implementation We'll learn the basics of module creation to build a simple featured-products module implementation which features products on a per category basis. This will outline the principles of structure and implementation of a basic module development useful for further development. In addition to this, we'll run through some quick tips that will help with Magento development. We'll try to resolve a few common issues that arise during development. Fully-featured module development with administration panels With this chapter, we'll be delving deeper into Magento by building a basic brand management module.

This will manage brands and display their details, which will be output in a dynamic template that has its own dynamic URL. PHP Developer's Guide This chapter will show the implementation and functioning of the administration section inside Magento, which allows management of our module from the backend. We'll then use this module and its backend for getting a dedicated URL on the frontend and a dynamic output for the managed data. We'll also go through using the Module Creator script, put together by to speed up our module creation process in the future.

This will cover the base installation of the Module Creator script and how to put it to use. Integration of third-party CMS In this chapter, we'll be covering third-party CMS integration, the possibilities and the helping aids in integrating our favourite CMS into Magento for data portability. We'll use Wordpress as a core example and implement Wordpress into Magento using a popular extension.

We'll also walk through other options available for implementation with other CMS. Magento's core API Every installation of Magento comes with an available data API for external scripts and internal scripts to interact with the Magento installation's data. We'll walk through how it can be used, setting up the API within an installation, and handling error feedback when it occurs during usage. We'll learn about the available methods which the API offers and see examples of what can be done with basic outlay of what comes with a default Magento installation.

Along with this, there will be practical examples of how to put the API to use with these calls to produce something viable such as a script to be used in the future. Importing and exporting data Managing data is an import aspect of Magento, and in this chapter we'll be discussing the built-in methods of mass customer, order, and product data available within Magento.

We'll go through how to import externally located files for retrieving and storing information from and to external sources, to mass update or export information with our Magento installation. The ideas gained by reading this book will enable us to use Magento to build something advanced.

J2T MASSCONF Magento extension

The internal functioning of Magento will be explained in depth, along with extending the present functions. This book will help us in developing our ideas into and onto Magento's default installation. We will go through the four methods that are available when installing and upgrading our Magento installation, so that we're able to pick the one that best suits our path in development.

This will ensure that we're able to upgrade the system, as necessary, when an upgrade is released for Magento.


  • Unsupported browser?
  • Magento Php Developer's Guide by Jamie Huskisson.
  • The Furniture Doctor: A Guide to the Care, Repair, and Refinishing of Furniture!
  • Magento PHP Developer's Guide | Now just $10.

Upgrading ensures that the system remains bug free and secure. Requirements The following are the specifications that Magento requires in order to run at a base level. These are not the requirements for tens of thousands of products but will have Magento running a small installation. These specifics are copied directly from the requirements page on MagentoCommerce. Self-signed SSL certificates are not supported Server - hosting - setup: The script can be downloaded from: After downloading this file, we must unzip it into a directory and upload the contents into our directory in which we want to install Magento.

This file starts with a When you run the PHP file to check the requirements and your server meets them, you'll see a screen along the lines of the following: If the Magento check fails, the server administrator or web host is to be consulted for advice. For instructions on dealing with other operating systems, there are plenty of Magento Commerce Wiki entries available at http: Just click the How to Get Started tab.

Types of installation We'll go through all the methods available for the installation of Magento, to extend our knowledge. It's not necessary to know all of them, but it will help us discover our preferred methods and the one which moulds itself to our development practices the best. There are four methods of installation available for Magento: None of the other methods make us do this and will automate at least small parts of the process. Unfortunately, not everybody's server environment allows the use of the other methods for various reasons.

So, the Manual method is vital for those stubborn or restricted hosting environments where we have no other choice. Installing We'll start by going to the Magento Commerce download page online, at http: There isn't any difference in the formats apart from the size. If we're unsure about the format which our computer can unzip, then its better to simply choose the most universally compatible format, the.

So we're free to switch to other methods for upgrading, after an initial Manual install. Once we've expanded the archive of files that we have downloaded, we connect to our FTP server, navigate to the folder where we want our Magento installation to reside in, and upload everything. When the upload process finishes, we must ensure that the folders and contents of the folders mentioned below are set to in CHMOD permissions: There are two ways to progress from here: We duplicate this file and save it as local.

Then we fill in all the details between the tags. This is best done after the first install of Magento, so that we can see how the data is formatted after the template is used by the graphical interface for populating data. The license agreement for Magento covers what we can and cannot do with the software. It's important to read it throughly if we have the time as it gives us a fantastic insight into the inner workings of the Open Source movement and how the licensing process works.

This screen allows us to set the default locale, the time zone, and the initial currency for our Magento installation. These can all be changed, once we go into the administration after installation finishes. However, it's best to set them right away so that we don't have to change them later. Clicking Continue after configuring these variables takes us onto the Configuration screen of the installation.

Base URL validation typically causes issues if setting a system up for a URL other than the one where we uploaded our files. Session storage options This provides us a choice between storing sessions in the file system or the database. It is the screen for creating an Admin account. The only part to take particular notice of is the Encryption Key field at the bottom.

It is advisable to leave it blank in the case of a standard installation. However, if we install a setup that corresponds with another on our server for example, a development or a testing version of a site , then we will need to copy the previous key into the Encryption Key field. It gives us links to both the backend and the frontend of our installation, in case we want to progress onto either.

Shopping Cart

Upgrading When an upgrade is required for our site, we can manually update Magento using the following routine. An upgrade is not required directly after an initial install. To upgrade the installation—using the Manual method with a full package download—we have to: Downloader The advantage of the downloader is that we have a much smaller initial download. Later the script can download the bigger files, saving the extra time taken to set up Magento. This reduces the initial download from between MB to 1 MB and is especially useful for slower connections. It also means we can stay away from FTP when it comes to upgrading in the future, as the downloader also allows us to upgrade existing installations that have been installed using other methods.

Installing To download from http: Expanding that displays a directory that looks similar to next screenshot: A screen welcoming us to the downloader is displayed: Once we click on Start the download process, we'll be presented with a screen that shows us the download progress. We must be patient, as it could take a long time before anything comes up. Magento is the most powerful e-commerce solution around and has gained popularity in a short period of time.

You can create and manage online stores using the extensive suite of powerful tools it offers.

Magento PHP Developer's Guide - Free Copies

However, because of its powerful features, developing with Magento can be easier said than done. This book will show you how to develop better and do more with the Magento. You will be able to extend and customize modules for the Magento system without editing the core system code. It will show you how to create both basic and advanced functionality modules for your store and help you turn your ideas for extending Magento into reality by building modules from scratch.

This book starts by walking you through the server requirements for installing Magento making sure Magneto's installation and upgrade process can fit into your workflow and suit your hosting environment setup. Then it runs through the architecture behind Magento's system, covering the core file structure and how the template system works.

You'll also learn how to build a basic shipping module, payment module, and a brand management module for Magento.

More titles to consider

As you delve deeper into the book you will learn how to integrate your favorite CMS into Magento for data portability. By the end of the book you will be able to take your basic knowledge of Magento and turn it into something advanced that will help you develop turn your ideas for extending Magento into reality.

Developer's Guide Chapter 2: Magento's Architecture Chapter 4: Building a Shipping Module for Magento Chapter 5: Building a Payment Method for Magento Chapter 6: Importing and Exporting Data Chapter Appendix A - Resources for Further Learning. A passionate year old freelance developer from Nottingham, Jamie Huskisson has been working with Magento for the past two years since the very early Beta versions. His development client list features names such as the NHS, Volkswagen, and Nike building everything from web applications to e-commerce stores and small business sites.

He also trains groups of developers and provides consulting on adopting open source technologies over closed systems for clients when required. Sign up to our emails for regular updates, bespoke offers, exclusive discounts and great free content. Log in to your account. Not yet a member? Register for an account and access leading-edge content on emerging technologies. Find Ebooks and Videos by Technology Android.

Join Kobo & start eReading today

Web Development Latest Releases. Packt Hub Technology news, analysis, and tutorials from Packt. News Become a contributor. Categories Web development Programming Data Security. Mapt Go to Mapt. Title added to cart. Search for eBooks and Videos. Design, develop, and deploy feature-rich Magento online stores with PHP coding.