Magento is a powerful and popular open source ecommerce platform that boasts a massive development community, some 3,500 available extensions, and an installed base in excess of 90,000 active stores.
In this tutorial series, I am going to demonstrate how to make a custom Magento theme. I will be using Magento Community Edition version 1.5.0.1, which is the most recent stable version at the time of writing. In this first, episode, I will introduce the project's client, briefly describe my development environment and the Magento installation process, and show you several of the graphic design compositions that I have been creating for my project.
Getting to Know the Client
This theme has a purpose; I will actually be developing it for a real client — a company named Athlete By Nature — based in Boise, Idaho. Athlete By Nature is a small wrestling gear retailer that sells primarily at events.
Basically the folks at Athlete By Nature set up tables at wrestling tournaments or visit schools in order to sell directly to individual wrestlers, teams, or clubs. The company's founder, Jacob, has also been known to make house calls, personally delivering headgear, shoes, or mouth guards to wrestlers — some of whom were waiting for the gear in order to compete.
Jacob and Athlete By Nature's other proprietors now want an online channel. They've asked me to help, and I am going to share with you what I am doing as I work on the project.
Setting Up My Development Environment
For this project, I am using Wamp Server which is a Windows, Apache MySQL, and PHP stack. You can download Wamp Server for free, which means that it is priced just right for this project.
Magento has several system requirements, so you will want to make sure that you all of the required PHP extensions. For the Wamp Server environment, I also need to turn off setting some session cookie parameters in Magento's Varien.php file located at app > code > core > Mage >Core > Model > Session > Abstract.
The code you need to comment out is at about line 81.
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
Just comment out the last three and be sure to remove the comma from the second.
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()
//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
);
To install Magento, prepare a MySQL database, download the latest stable release, unzip it, and place it in your development environment. Then double check that you have the required PHP extensions, and point your browser to the folder you placed the files in.
You should see the Magento installation wizard.
After you have accepted the license agreement, the wizard will ask you to set your location and preferred currency.
Next, you will provide Magento with the name of the MySQL database you created and the associated credentials.

If you get a warning about your base URL not being valid, and if that URL looks like http://localhost/some-directory/magento/, you can hack the form field to get it to work. Use a tool like Firebug or Chrome's developer's tools to remove the validate_url class from the input field and then resubmit the form. Hopefully, the Magento folks will fix this in a future addition.
This step in the installation process can take a few minutes.
Load your personal (think user) information next. You also get an encryption key that you should file for safekeeping. I make a screen capture of the key and save the image.
Using Magento's Functions and Features
Magento's standard features and functions — with the exception of an integrated blog — should work very well for the folks at Athlete By Nature. So I won't have to do any custom module development. This is good news, since it means that the project should move more quickly.
It also means that I can use an existing Magento theme as a starting point for my own custom theme development. In this case, I am going to use the Modern theme as my starting point. This theme is included in the basic Magento installation.
To add it, I navigate to the Magento backend, go to System > Configuration > Design, and add "Modern" to the "Skin," "Layout," and "Default" fields.

Graphic Design
Although I have my development environment ready, I am still not quite done with the graphic design portion of the project.
I met with the Athlete By Nature folks, went over their needs and wants, and got a list of several sites that they liked. From that meeting, I produced three initial graphic designs.
Jacob provided me with some excellent feedback about the compositions, and I produced a single design for the second round.
There was more discussion about the design, and then a third-round composition.
The only feedback that this comp received was related to the font face. Jacob and the Athlete By Nature team wanted to use Footlight MT Light, which is also featured in their logo. I tracked down the font, got a license, and generated a fourth-round composition using Footlight MT Light just about everywhere. I had to reposition some of the text to get things to layout well with this serif font.
The folks at Athlete By Nature said that they really liked this fourth-rounder, but I still don't have the official stamp of approval.
Summing Up
In this first episode of the series, I introduced you to my client, described my development environment — I even walked you through the Magento installation — and shared some of my initial design work.
As the series goes on, I will be creating a custom Magento theme for the Athlete By Nature site. Sometimes, I will use video to demonstrate what I am doing, other times the "episode" will feature text and pictures.
Finally, don't be surprised if you are experiencing a bit of deja vu, this is actually the second time I have written a Magento theme series on Ecommerce Developer, but enough has changed with the Magento platform to make this new series worthwhile.
This Series
- "Part 1" Getting Started
- "Part 2" Integrating WordPress
- "Part 3" Cache Management
- "Part 4" Modifying the Templates
- "Part 5: @fontface and Category Labels"
- "Part 6: Style and Position for Category Navigation"
- "Part 7: More Header Work"
- "Part 8: More Search and Navigation"
- "Part 9: Background Rotation"
- "Part 10: Clearing the Main Content Area"
- "Part 11: Preparing for the Content Slider"
- "Part 12: Beginning the JavaScript for the Content Slider"
- "Part 13: Positioning Slides"
- "Part 14: Fading Transitions"
- "Part 15: Content Slider Icons"
- "Part 16: Synchronizing Slides and Icons"
- "Part 17: Finish the Content Slider"
Related Articles
- Add Custom PHTML Templates to Magento CMS Pages
- Add Custom Fields to Magento's Contact Us Form
- Building a Magento Theme Start to Finish, Part One: Prolegomena
