Magento for Designers: Part I

Magento for Designers: Part I

Magento is a stunningly powerful e-commerce platform. In celebration of ThemeForest’s new Magento category, this mini-series will you teach how to get started with the platform, getting to know the terminologies, setting up a store and all related aspects of it, and finally how to customize it to make it our very own.

In this first part, we’ll get to know what Magento is, installing it, and importing some products. This is aimed expressly at the beginner; so you need not worry about lacking the requisite skills. We’ll walk you right through! Excited? Let’s get started!


What exactly is Magento?

Magento

Running an e-commerce site is a daunting task what with almost all of the current platforms being lumbering beasts ill-suited to current standards. Magento promises to fix this and a lot more.

Magento is an extremely powerful and feature filled e-commerce platform. And it’s open source to boot! It comes filled to the brim with all the features and tools you’d need to get your e-commerce web site up and running as quickly as possible.


What Features Do You Get?

Tutorial Image

Magento is replete with a number of features which are hard to find or maybe even unheard of in most of its competitors. Salient ones include:

Flexible Payments

Often used payment processors including Paypal, Google Checkout, USAePay and Authorize.net are supported along with support for traditional methods such as credit cards, money orders and checks. Plenty of modules are also available to make it works with a myriad other payment processors.

Robust Checkout Process

All the features you’d expect out of a mature product including 1-click checkout and full SSL support are present.

Full Fledged Analytics

Magento provides complete analytics and reports for your stores. No need to use a third party solution anymore!

Product Reviews and Ratings

Out of the box, you can setup the store so that a customer can rate an item up or down and leave a review.

Search Engine Optimized

Magento is 100% Google friendly and supports Google Site maps to boot.

Marketing Promotions

A number of different promotional options including coupons and discounts can be made use of right off the bat.

And many, many more

There are truly too many features to cover in a single article. To be frank, you’d need an entire book to cover what Magento can do. Magento almost has every facet covered.


Which Version to Choose?

Tutorial Image

Now that you’re excited about Magento, you probably can’t wait to get started. But before that, we need to choose which version to pick.

Magento comes in two flavors:

The Enterprise edition is for organizations running mission critical stores. It comes with 24/7 support and numerous features you’d expect out of an en enterprise level platform including a more robust CMS system, support for gift certificates and more. But on the flip side it weighs in at $11,125 per year.

The Community version meanwhile is completely free to download and use and you’re at complete liberty to modify it to suit your needs. The only thing you’d be giving up will be the robust support but the active community more than makes up for it.

We’ll be taking a look at the community edition today.


Server Requirements

Magento has modest server requirements but it doesn’t hurt to make sure we have everything in order. Here are the official requirements:

  • Apache 1.3+
  • PHP 5.2+
  • mySQl 4.1.2+

There are ways to make it work with PHP 4 but honestly, it’ll be easier in the long run to just upgrade your PHP installation.


Prepping for the Installation

First, you need to obtain a copy of Magento. If you’re a SVN person, checkout a copy from http://svn.magentocommerce.com/source/branches/1.4. Else, you can just it get it from here.

Tutorial Image

We also need a database for Magento so we’ll set it up as it downloads. I’m assuming you already have a LAMP setup in place.

Tutorial Image

On successful database creation:

Tutorial ImageI’m making a note here. Huge success!

Importing the Sample Data

We’ll need to import some sample data to our newly created database before we install Magento.

Tutorial Image

First up, download the SQL for the data.

Tutorial Image

Import it through phpMyAdmin and let it do all the rest.

Tutorial Image

Installation

Now we can move on to the actual installation. Magento, being a mature platform, has a relatively simple installation process. All you need to do is input a few values, click on the continue button and you’ll be on your way to a working Magento installation.

Tutorial Image

First, up we need to accept the license agreement. It’s mostly boilerplate but give it a quick read. Finally accept the terms and click on the continue button.

Tutorial Image

Set up your location, preferred currency and time zone in the next screen. You can, of course, change all these later through the administration screens.

Tutorial Image

Like me, if you’re daft, you might have forgotten to enable some of the PHP extensions Magento needs. In that case, enable the extension Magento needs and then retry.

Tutorial Image

You can now input the database credentials Magento needs to set it all up. You can also adjust the base URL of the store and the path to the administrative panel.

You can also set up clean SEO URLs right off the bat here.

Tutorial Image

Finally, you need to setup your admin account so you can manage everything. Magento needs an encryption key for encrypting sensitive data. If you have one at hand, type it in. Else let Magento generate one for you.

Tutorial Image

And we’re done. Magento has been successfully been installed.


Fix for Local Test Servers

If you’ve tried logging on to your fresh installation, you’ll get errors asking you to enable your cookies. This is because browsers generally tend to not store cookies for URIs without a period in it. localhost thus fails to store a cookie which leads to problems logging in.

Solutions to this problem range from using 127.0.0.1/magento instead of localhost to modifying Windows’ host file to manually redirect it. Nonetheless, since this is only going to be the test setup, we can just bypass said cookie-check.

Open up Varien.php at magento\app\code\core\Mage\Core\Model\Session\Abstract and find the following snippet starting at line 77:

// session cookie params
        $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
            'domain'   => $cookie->getConfigDomain(),
            'secure'   => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly()
        );

        if (!$cookieParams['httponly']) {
            unset($cookieParams['httponly']);
            if (!$cookieParams['secure']) {
                unset($cookieParams['secure']);
                if (!$cookieParams['domain']) {
                    unset($cookieParams['domain']);
                }
            }
        }

        if (isset($cookieParams['domain'])) {
            $cookieParams['domain'] = $cookie->getDomain();
        }

Now comment out the relevant parts like so:

// session cookie params
        $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
            'domain'   => $cookie->getConfigDomain(),
            'secure'   => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly()
        );

       /* if (!$cookieParams['httponly']) {
            unset($cookieParams['httponly']);
            if (!$cookieParams['secure']) {
                unset($cookieParams['secure']);
                if (!$cookieParams['domain']) {
                    unset($cookieParams['domain']);
                }
            }
        }

        if (isset($cookieParams['domain'])) {
            $cookieParams['domain'] = $cookie->getDomain();
        }*/

Importing Custom Products

We’re all but done here. We’ve installed Magento and added some sample data to get a taste of the platform. But it’d be more useful if we could import some of our own products before leaving. For a few, manually importing them shouldn’t be a problem. But when they move into the tens, this should be a problem.

To that end, this simple technique should come in handy. There are, of course, more sophisticated ways to import data but they require a tad more Magento expertise so we’ll be tackling it later on in the series.

Step 1: Export the Sample Products

Tutorial Image
Tutorial Image

Step 2: Understand the way the CSV is Structured

Study the structure of the CSV. Once you’re understood it, you can easily just add products directly to the CSV file. Feed it into a spreadsheet program to make this part even more easier.

Step 3: Import the Updated CSV into Magento

Tutorial Image
Tutorial Image

The Last Word

And we are done! We looked at what Magento is, the features it offers, how to install it, how to get some sample data in and finally how to get our own product data in. If you think it was a little too beginner level, fret not. This first entry is aimed primarily at the designer who wants to get his/her feet wet with Magento. We’ll be ramping up the difficulty as the series moves forward.

Questions? Nice things to say? Criticisms? Hit the comments section and leave me a comment. Happy coding!


Purchase Magento Themes from ThemeForest

ThemeForest

Did you know that your friendly neighborhood ThemeForest sells premium quality Magento themes? Whether you’re a skilled Magento developer looking to start profiting from your efforts, or a buyer, hoping to build your first eCommerce store, we’ve got you covered!



Leave a Reply

Your email address will not be published. Required fields are marked *