Category: Magento

Book Review: Magento Site Performance Optimization

Magento Site Performance Optimization book coverMagento Site Performance Optimization by Mathieu Nayrolles is a handy little primer on the basics of optimizing a server for magento. This little gem covers the basics, doesn’t spend a lot of time on fluff, and moves quickly into optimizing MySQL and covers the basics of using two mysql instances (through replication) one for writing and another for reading.

Chapter 1: Starting with the Right Hardware covers the basics of choosing what hardware is necessary, and how to decide who is a good host. I found the section of choosing a host to be very light because it basically suggests finding a magento recommended host and finding somebody located in the same country. It didn’t really cover much in the way of latency, dns, etc. The section on Content Delivery Networks left a lot to be desired, and really should have looked at some of the avaialble plugins.

Chapter 2: Choosing the Best Web Server is about some of the different options available out there for serving websites on linux. Makes perfect sense to cover the normal Apache and lighttpd. The Apache section discusses the standard .htaccess modifications, compiling Apache with some of the modules, and disabling what you aren’t using. Overall, the Apache section was good for a basic primer. I’m interested in using lightttpd more after reading a bit about it.

Surprisingly, Mathieu also covers Nginx which turns out to be much better for hosting magento once it’s properly tuned. This chapter was one of the most interesting and useful to me. I haven’t ever really looked at the numbers in the way he presented them or decided to try and load test configuration settings as I made each one.

Chapter 3: Tuning, Scaling, and Replicating MySQL covered exactly like the title says. This chapter discussed a bit about some of the different scripts available, but the real gem was the discussion about replication and how to configure it in magento. I didn’t realize I could setup two mysql instances and have magento read and write to different ones.

Chapter 4: Caching Them All starts off with one of the first things I try to do with caching. Turn off most of it, and see how much it changes performance. On nearly every system, I’ve worked on the performance has actually improved because writing to files and reading the files for differences is usually more expensive than just pulling the data again from the database.

Mathieu presents a reall interesting approach, that again I hadn’t really thought of which is using the RAM hold /var/cache which seems like it could be a significant improvement for the caching since most sites are using SCSI drives and not SSD like his examples.

The different caching technologies covered aren’t covered in great detail, and don’t really have that same level of details as Chapter 2 which was pretty disappointing. I had hoped we would spend some more time and energy discussing full page caching, which I find to one of the greatest optimizations to be using full page caching.

The real beauty of Chapter 4 is the section on HipHop Virtual Machine (HHVM) which is something I’ve actually never heard of before. I can’t wait to try it in the next few months and test it on on my site. HHVM is open source and produced by Facebook.

Overall, I found the book to be detailed, easy to follow and full of useful information. Also fantastic is the fact there aren’t twenty pages devoted to installing magento; the book is free of fluff and really introductory details. I also felt that it really left a lot to be desired too. Hopefully, in the next version they can spend a bit more time discussing hosts,content delivery networks and some of the code enhancements that can be done to improve speed.

Why I Recommend PayPal

I spend a significant amount of my timing deal with ecommerce and different shopping systems. One of my all time favourite solutions is using PayPal and Magento together because they have been designed from the ground up to interact well together.

International Acceptance
PayPal is accepted in many countries and is capable of doing automatic currency conversion.

PayPal is very easily integrated in all open source shopping carts, and is often freely available requiring very little work for developers.

No Monthly Fees
Many of the other merchant systems require monthly payments even when your business is closed. PayPal charges a per transaction fee which all of the merchants also charge! If you’re accepting debit the transaction fee could be fairly expensive, but usually it is much cheaper for credit card transactions.

Lots of Payment Options
PayPal does e-checks, American Express, Visa, MasterCard, and Discover. PayPal is expected to release applications for smartphones, and the iPad very soon which will allow you to use your device as a wireless terminal.

You won’t need to spend time worrying about PCI compliance, because the credit card transaction is actually stored and processed on PayPal’s end. Money is usually transferred immediately for credit card transactions.

There are some other shopping solutions available, but don’t expect them to work as well or be as affordable PayPal.

Hope this helps!

Magento CheckOut Page Blank

I had a very strange issue with a client’s installation of magento a few nights ago. The checkout page was completely blank and the apache error logs were completely empty.

I tried all the usual fixes of looking at file permissions, updating the magento installation, checking for new modules, etc but none of these solutions solved the problem. Eventually, someone on the forums suggested to me that maybe I should see if Compilation was turned on. I completely forgot that I had turned on System Compilation to increase the performance of the site.

After, i went into ystem → Tools → Compilation and disabled it, the checkout page started working again and customers could continue to order.

Add A Facebook Like Button

A while ago, Facebook created the Facebook Like Button that works by using an iframe of FBML. The Like button allows you to easily get some free social media coverage with consumers.

Many websites and blogs are making use of the Facebook Like button and any other ways possible of sharing on social media networks because the cost is so minimal and publicity is so important to any business.

Adding the button is extremely simple, although it does require some editing of .phtml files, an ftp client, or experience with VI or EMACS if you have SSH access.

Step 1: Open up app/design/frontend/default/{{YOURTHEMENAMEHERE}}/template/catalog/product/view.phtml

Step 2: Search for the following code.

getReviewsSummaryHtml($_product, false, true)?>
getChildHtml('alert_urls') ?>

Step 3: Paste this code between the two lines of above code.

<iframe src="<?php echo $_product->getProductUrl(); ?>&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>

Step 4: Open up your website and view a product. If you can’t see the Facebook Like button you may need to clear the Magento Cache.

Hope this helps and good luck with your business!

How to Tell What Version of Magento

The easiest way of telling what version of Magento you are running is by viewing file app/Mage.php and looking for a function called getVersionInfo().

The function should look something like the following and be fairly self explanatory to most developers.

public static function getVersionInfo()
return array(
'major' => '1',
'minor' => '5',
'revision' => '0',
'patch' => '1',
'stability' => '',
'number' => '',

Hope this helps!

Magento An Introduction

What is Magento?
Magento is an open source eCommerce platform with two versions: Magento Community Editon, and Magento Enterprise Edition. Magento is developed by Magento Inc and is built upon PHP, and the Zend Framework.

The Magento Community Edition uses the Open Software License (OSL) v3.0 which is sufficient for most online stores.

Why use Magento?
Magento is extremely flexible, and requires very minimal customization to have a fully functioning store. In addition, Magento has incredible search engine optimization built into from the start which allow you to quickly start marketing to web users and get noticed by search engines. For a list of all of the awesome features, you should check out the official Magento Features.

Why do I recommend Magento?
I recommend Magento because of the ease of customization, amazing flexibility, and the quickly growing library of extensions which are often free or very low cost. We offer services for Magento, and aren’t afraid to help customers migrate from oscommerce or some other open source system.

What do I need for Magento?
For Magento to run you need MySQL, PHP, and good quality web hosting. We don’t recommend shared hosting to any of our clients, and think you shouldn’t use it either!

How to Add CSS & JavaScript to a Magento CMS Page

Magento is an insanely flexible system that has a lot of potential, but of course with this flexibility comes a lot of learning.

Adding a JavaScript file and a CSS file to a specific CMS page isn’t very difficult. We should always consider adding the JavaScript file or CSS file to the theme if we’re going to use it on more than one specific page. Continue reading

Displaying The Newsletter On a CMS Page/Block

I really like magento, and a lot of the built in features although it can be difficult sometimes to figure out how to use things. Displaying the newsletter in a CMS Page / Block is pretty easy.

Just simply paste the following code into the design block, and away you go!

{{block type="newsletter/subscribe" template="newsletter/subscribe.phtml"}}

Hope this helps!

Magento Add/Edit Footer Links

Editing the footer links in magento is actually pretty easy. By default, there should be a static block called footer_links.

The static block starts off with at least these two links: About Us, Customer Service. Editing is as simple as signing into the admin, and Clicking CMS->Static Blocks->footer_links and making your changes.

Good luck!

Magento – Stuck in Maintenance Mode

After upgrade magento to, my client’s website was stuck in magento maintenance mode. I wasn’t able to easily find a way to fix it by looking in the normal database tables, but did locate a file called “maintenance.flag” in the magento root.

So, to fix maintenance mode look for the maintenance flag and remove it and your shop will be back online!

How do I upgrade magento?

Before you upgrade magento you should be sure to make a complete back up of your files and your database. (It also isn’t wise to test the upgrade on a production store!)

To upgrade the easiest way is to make use of downloader, using a user with permissions, sign in, and then use the following extension key:

For more information and alternative methods visit the wiki article.

Magento – Adding Feaured Products to Front Page

The owner of Nature Bumz wanted to be able to add featured products to the home page of their magento store each day without having to modify to edit the content.

Inchoo has created a great extension, called Featured Products, that features a great backend allowing the admins to choose featured products from a simple grid. (Catalog -> Featured Products.)For the front end, it’s very easy to add the required code to the content:
{{block type="featuredproducts/listing" template="inchoo/block_featured_products.phtml"}}

Don’t forget to refresh the cache after you install through downloader or you might get some errors. 😉

Magento – Setting Paypal to Redirect Back

Quick steps on how to redirect back to your magento store upon a successful purchase. Unfortunately, you can only redirect to one page.

      Sign into Paypal account
      Click directly on Profile -> Website Payment Preferences
      Change Auto Return to on.
      Fill Return URL to
      Save and then go test it!

After a successful paypal payment the customer will be redirected back to the magento order success page. Hope this helps!

BRCline Consulting – 1st Magento Site

BRCline Consulting has been busy working on its first ecommerce site to create Niagara Fall’s Natue Bumz Cloth Diaper Shop.

The owner, Crystal Cline, needed to accept paypal, credit cards, and be able to create her own blog along with adding inventory, and all of the traditional sort of business functions. I chose magento to take advantage of the large exploding community and realized I would really only need to create a theme along with doing some configuration to give Crystal exactly what she needed.

Check it out.
Nature Bumz - Cloth Diapers - Niagara Falls