Category Magento

5 Magento Modules You Cannot Live Without

Having spend the last few months working on a major Magento upgrade I thought I would share the modules that I would recommend as Must Have magento backend modules for anyone building a new Magento store.

1.  Fooman Speedster

This one has been around for a few years, but its a must have for improving your javascript and css optimisation. Magento now gives you the option of combining CSS and JS files to improve optimisation, Fooman assists this process. Note that you still might benefit from compressing your source CSS files yourself.


Magento has its own internal cron system used to schedule tasks such as sending emails. The cron tasks and configurations are all in the Magento database which makes it difficult to look at them, to find out for example if they are running correctly or when they last ran. The Magento Cron Scheduler gives you a great admin interface to let you see all the cron tasks and configurations. It also lets you manually run a task which is really useful when you are debugging orders and want to force Magento to send a new order email straight away.

3. OP Cache Admin

OP Cacheing for PHP is a must have for Magento, make sure it is enabled and use this admin interface to view stats and settings.


Making Magento load fast is really important. A lot of the recommended caching options require some major redesigning of your Magento deployment. For a really simple full page cache solution try this out. It will work straight out of the box and you will be very surprised at how quickly pages load. A word of warning though, you need to test this thoroughly on your DEV site to make sure it will work for you. If you do custom layered navigation you need to tweek the config to tell the system which queries it should and shouldn’t cache. If you are rendering different front end data for different customer groups then my recommendation is to modify the module to only full page cache sessions that are not logged in.


Looking to implement multiple tier prices, this module works perfectly out of the box to implement correct tier pricing for configurable products with multiple options.

Magento, Poodle and Paypal – Disable SSL v3 Before December 3rd


The so called Poodle security vulnerability was announced by Google last Month (October 14 2014).

The vulnerability effects SSL v3.0 a transport protocol which has been around for over 18 years and is used to secure various TCP/IP protocols the most common of which being HTTPS so it is present in a lot of client and server software.

The workaround fix to mitigate this vulnerability is to simply disable SSL v3 support and fallback (or upgrade) to using the newer TLS 1.x protocol.

The vulnerability seems to be a real cause for concern for a lot of companies especially Paypal who announced recently that the will disable SSL v3 support on the 3rd of December 2014.

How does this affect Magento

In respect to Paypal payments from your Magento store using either the Standard or the Express payment model Magento behaves like a client communicating with the Paypal API over SSL to complete the Payment / Checkout transaction.

When Paypal removes support for SSL v3 your Magento store will no longer be able to communicate with Paypal unless you disable the support for SSL v3.0

Simply put this means you will not be able to process any orders with the Paypal payment system. Not the best news at this time of year when many businesses are in the middle of their busiest time of year on the run up to Christmas.

HOW TO Fix Poodle for MAgento

Fortunately the fix is pretty straight forward and actually doesn’t really have anything to do with Magento at all but rather the configuration of your web server software on your Magento host.

First you need to determine if the host your Magento shop is running on is using the SSL v3 protocol.

If you have command line access to your host, login and run nmap with the following command :

nmap –script ssl-enum-ciphers -p 443 localhost

If your host is NOT vulnerable you will see

SSLv3: No supported ciphers found
If you don’t have command line access run an external scan from a reputable  site such as Symantec, The scan should clearly show you if your server supports SSL v3 or not.

How to Disable SSL v3 on Ubuntu Server

To upgrade to TLS 1.x and disable SSL v3 support on Ubuntu server, and many other servers running Apache locate the configuration file responsible for defining the SSL protocols supported by Apache. On Ubuntu it is
You can search for it with this grep command:
grep -i -r “SSLProtocol” /etc/apache2
Edit the file, find the SSLProtocol line and change it to
SSLProtocol all -SSLv2 -SSLv3
Restart Apache (service apache2 restart) and SSL v3 will be disabled.
Confirm this by running the scans again.

How to test Paypal

The best way to prepare for Paypal disabling SSL v3 is to test your Dev Magento install against the Paypal Sandbox site –

For peace of mind you should do this before December 3rd 2014.

Another simple test is to just do a simple PHP curl request to the Paypal sandbox servers. You can try this with a simple PHP script. Create a file paypal-tls-test.php in the root folder of your Magento shop and paste the following script into it.

$url = “ssl://”;
$fp = fsockopen ($url, 443);
if (is_resource ($fp)) {
echo “not affected”;
else {
echo “affected”;

Run the script from your store –

If you receive the not affected response, then your host was able to talk to Paypal using TLS and you should also be able to process Paypal payments from Magento.

If you don’t have a dev server this might be the easiest way to test Paypal access from your Live server unless you are prepared to take the shop offline and configure the Paypal payment modules to use the Sandbox.

If you do not have access to the command line you need to talk to your hosting provider ASAP!

A lot of people (like me) may be reacting to this news a bit late but applying these simple changes should avoid any pre Christmas Poodle related Paypal headaches next week.



Magento Product Attribute Search and Filter

Magento Product Attribute Advanced Search and FilterThe Magento product database is pretty flexible when it comes to extracting product information. Sometimes however, extracting all the information you want for a product is not so easy.

For example you want to extract the main product info, price, title, SKU etc and all the product attributes names and the product category. This might require multiple product / collection calls and when you multiply this by a search across 1000’s of products can become slow.

Magento Product Attribute Search and Filter

I wanted to provide a quick and easy way to search and filter magento products by attributes, in this case by colour, so customers could quickly narrow product selection down by selecting a colour and a filtering by category.

To extract the data I developed my Magento Product Data and Attribute exporter. This let me initially see how many attributes I had to work with, in this case how many different product colours were already configured.

To make colour selection simpler I created a new Magento attribute product_primary_colour and added a primary colour to each product so that I ended up with about 16 main colours that would provide a match to all the existing product attribute colours.

Once I had all my exported product data in a tab delimited text file I quickly realised that it would be relatively simple to search and filter this data via ajax requests.

I had initially thought it would be more effective to do the search within Magento using product collections but the speed of the search against the delimited txt data file made me think again. When I then added cached search results using Memcache I was happy that this solution would work.

The benefits of using the flat txt file are that it is quick and can run completely external from Magento in another webapp or in WordPress or Facebook.

The Magento attribute search and filter is easily customiseable and can search the data created by the export script filtering results from any of the product data columns in the export file. This could be colour, size, type etc, there are no limits.

If your product data is changing regularly simply export the data regularly via a cron job to keep it up to date.

if you need to filter your data by a completely new attribute simply pull the export data into Excel, create your new attribute data and corresponding Magento attribute and import the data back into Magento. Now you can export this data and easily search and filter it.

Here is an example of the attribute search running in an iframe using the Magento test product data. Here I have exported the color attribute, and am filtering against existing product categories like Womens, Mens and Shirts (note Mens matches Womens, some refinement needed there!). This will also easily run in Magento when setup in a static block containing the iframe data.

You can see how quickly the data is filtered and returned, try a search for Red to see some data. Click around the categories and check the debug footer which shows if the results were cached or not and how long the ajax query took to run.

Data from Magento DEV Store running Magento 1.9.x

Magento Product Data and Attribute Exporter

Export Magento Product and Attribute DataOver the last few years I have developed a few different PHP scripts to export Magento product data in order to manipulate product pricing, generate Magento  EAN barcodes or create product import data.

Recently I had to export Magento product data to be used as import data for Amazon product listings. Specifically the products had a lot of different attributes associated with them and I wanted to export each product with all of its associated attribute data to map to the relevant Amazon product data.

To accomplish this I returned to my previous code and enhanced it to be able to export user defined Magento product and attribute data to a delimited text file (as well as creating product EAN barcodes which was a function of the original script.)

The script can extract the usual global product data e.g. price, description etc. as well as any custom product attributes.

The export data is configured in an array;

‘name’ => true,
‘description’ => false,
‘imageurl’ => true,
‘producturl’ => true,
‘type’ => false,
‘ean’ => false,
‘category’ => true

We set the array key value to true or false for the product data we want to export. The same applies to attribute data:

‘colour1′ => ‘color’,
‘custom’ => ‘my_custom_attribute’

So here we are exporting the color product attribute as well as a custom attribute.

The tab delimited data is easily imported into Excel for manipulation and further import/export, for example adaption to an Excel format compatible with Amazon product imports.

This data can also become really useful if you want to provide fast external access to your product info for example, in an external app, on Facebook or even within Magento. See my product attribute search app for more information.

You can download the source code for this export script from my Github.

To run the script copy the files to your server and edit the configuration php file config/applicationConfig.php. Configure the paths to your Magento installation and the folder to export to.

Configure the product arrays by editing php/Application.php, edit $_getProductData and $_getProductAttributes.

To run the script execute it with php export.php debug from the command line. To run silently from a cron job leave the debug switch out.

You can also run the script from your web browser if you install it in a web accessible folder.

Here is an example of the output from my Magento dev store ::

id	sku	name	imageurl	producturl	category	colour1
51	1111	Ottoman	Living Room	Red
52	1112	Chair	Living Room	Red
53	1113	Couch	Living Room	Red
83	cn	CN Clogs Beach/Garden Clog	Mens	xxx
29	cn_3	CN Clogs Beach/Garden Clog	Mens	Blue
84	cn_4	CN Clogs Beach/Garden Clog	Mens	Blue
85	cn_5	CN Clogs Beach/Garden Clog	Mens	Blue


Upgrade Magento 1.8 to 1.9

Magento Upgrade

Magento CE 1.9 has been released. It appears to be a relatively small update introducing a new responsive GUI. See the release notes here.

Here are my notes after upgrading my dev store from 1.8.x to 1.9 using the command line.

Backup existing install folder and database

1. Magento source
tar -cvvf /home/backup/magento.tar /home/www/magentoinstallfolder/

2. Magento DB
/usr/bin/mysqldump -h localhost -u USER -pPASS magento | gzip > ~/backup/folder/db-magento.sql.gz

1. Remove cached files and temp files

rm -rf downloader/pearlib/cache/*
rm -rf downloader/pearlib/download/*
rm -rf downloader/var/cache/*
rm -rf downloader/var/report/*
rm -rf downloader/var/tmp/*
rm -rf media/catalog/product/cache/*
rm -rf media/tmp/*
rm -rf var/cache/*
rm -rf var/session/*

2. Restart memcached (if being used)

3. Sync mage

./mage mage-setup

./mage sync

4, Run upgrade

./mage upgrade-all

5. Reset ownership and permissions on all files and folders.

Check Magento is operational, login and refresh caches.

If all is well take a well deserved break and maybe eat a cream cake. If all is not well restore from backup…



Google Universal Analytics Update for Magento Version v.1.3.X Old Versions


Google Universal Analytics went out of BETA recently (May 2014) and is now available for all users. Universal Analytics has “more features, better insights”.

All versions of Magento include the client side analytics code which can be enabled in Magento Admin. When enabled Magento creates the client side html and javascript and appends it to the footer section of each page.

On the checkout completion page additional code is created to track sales.

Google Univeral Analytics Magento

Google Universal Analytics uses new client side javascript code, this means Magento does not yet support Google Universal Analytics by default, however it is relatively easy (if you are using new versions of Magento) to override the base/default Magento code that creates the client side analytics html and javascript.

If you simply turn off the built in Magento analytics feature and add the new Google Universal Analytics code to your page templates (as Google suggests you do) then you will lose all eCommerce tracking.

You can update your Magento core code to support Google Universal Analytics using the information below.

New Versions > 1.4.x

If you are using a newer version of Magento i.e. > 1.4.1.x you can update the core analytics functionality following the guidelines here.

Old Versions < 1.4.x

if you are using an older version of Magento (before 1.4.1) i.e. Magento 1.3.x, I have adapted the Magento v1.3.x google analytics core module code to support Google Universal Analytics. The code can be installed as a local module and will override the core module.

Download the code from my GitHub

To install the module copy the files to your Magento app folder, refresh your Magento configuration and configure the settings under Configuration -> Google API -> Google Analytics.

To view the analytics code look at the source code of any page, scroll to the bottom and look for the code between the Google Universal Analytics Code comment tags. For order tracking information, check the code on the Checkout/Success page.

Magento SEPA Migration Check List

The Single Euro Payments Area (SEPA) is a payment-integration initiative of the European Union for simplification of bank transfers denominated in euro.

If you make or accept payments via direct bank transfers then you will know all about SEPA. As a customer online payment method direct bank transfers are popular in some countries (i.e. Germany) and not so popular in others (i.e the UK).

The deadline for SEPA payments was 1st February 2014 but (as of the time of writing) has been extended 6 months to 1st August 2014.

SEPA standardises bank transfers in Europe, replacing bank specific account and sort code numbers with an IBAN (International Bank Account Number) and BIC (Business Identifier Code).

For most businesses the migration to SEPA involves communicating the new changes to customers and migrating bank account numbers and sort codes to IBAN and BIC.

For Magento stores if you have a payment method that allows customers to pay via a direct bank transfer then you need to ensure that you can capture IBAN and BIC numbers at checkout. Until 1st August 2014 you can decide to give the customer the option of entering either bank account number and sort code or IBAN and BIC. From August 1st you *should* only be accepting IBAN and BIC.

Here is what you need to do to get your Magento Store ready for SEPA payments

  • Make sure you are capturing bank account information in the SEPA format – IBAN and BIC at checkout.
  • Check that your validation rules work for the IBAN and BIC formats.
  • Make a note to remove input fields and validation rules for old account formats, bank account number and sort code.
  • Upgrade your existing debit payment methods to make sure they support SEPA.
  • Implement a validation system for IBAN and BIC

This debit module is perfect for German Magento shops implengint Direc Debit (Lastschrift) payment methods and supports SEPA :

To validate IBAN account numbers with PHP take a look at



Javascript only EU Law Cookie Notification Message for WordPress and Magento

You know sometimes you just want a quick solution to a problem and wherever you look there are just complex, overpriced scripts that make your simple problem sound like something that needs a lot of code and money to get to work.

I needed to display a cookie notification message on a wordpress and magento site, to avoid compatibility problems I wanted to avoid using jQuery and just do it as simply as possible in javascript.

After looking around at a lot of $10 jQuery solutions I found a free javascript only solution, modified it for Magento and WordPress and implemented it.

Download the code from Github here

Whatever your opinion of the EU Cookie Law which came into effect in 2012, sooner or later if you are in Europe you may need to show that you are doing something about it. Err actually it’s 2014, so I guess we are already a teeny weeny bit late.

From what I understand the law may differ in various countries (certainly outside Europe), so depending on where your website is, and who visits your site the law may or may not apply to you.

This script will let  you quickly implement a cookie notification banner with a link to your privacy policy. The notification itself uses cookies and will not be show again when closed.

You can implement this solution on any website by copying the install files to your web server and adding the following code to the footer of your site.

<script type=”text/javascript”>

var cookieNotificationURL='/cookies/';
var cookieNotificationLifetime=180;
var cookieNotificationMessage='This website uses cookies. For more information please ';
var cookieNotificationClickMessage='click here';
var cookieNotificationMessageFade=true;
var cookieNotificationPath='/path-to-install-folder/

<script type="text/javascript" src="/js/cookienotification/cookie.notification.min.js"></script>

This sets up some variables used by the script, the URL of the privacy info page, the lifetime of the cookie used by the script in days, messages displayed, the option to fade the message automatically and the path to the install folder – used to display the close image.

For wordpress simply paste this into the footer php file of your theme.

For Magento paste this into the footer.phtml template file of your Magento theme. You can translate the messages, and perhaps a good idea, choose to display the message only on non SSL pages – we don’t want this javascript to somehow screw up a sale!

<?php if (empty($_SERVER[‘HTTPS’]) && $_SERVER[‘HTTPS’] = ‘off’): ?>

<!-- Cookie Notification -->
<script type="text/javascript">
var cookieNotificationURL='/datenschutzerklaerung/';
var cookieNotificationLifetime=180;

<?php if (Mage::app()->getStore()->getId()==2): ?>
var cookieNotificationMessage='This website uses cookies. For more information please ';
var cookieNotificationClickMessage='click here';
<?php else: ?>
var cookieNotificationMessage='Diese Website verwendet Cookies. ';
var cookieNotificationClickMessage='Klicken Sie hier für weitere Informationen.';
<?php endif ?>

<script type="text/javascript" src="/js/cookienotification/cookie.notification.js"></script>
<?php endif ?>

Here I am manually checking the store id and translating the text to German. Remember to refresh your Magento cache after editing and saving the footer template file.

You can see the code working on this WordPress blog below, and also with Magento on my Magento development site.

Tested with Magento 1.8.x, WordPress 3.blah, Chrome, Firefox, IE11. Detects mobile devices and modifies banner size accordingly.

Upgrading Magento 1.7 to

A few notes after upgrading to Magento from

Make sure you backup your Database and Magento source directory first! My first upgrade attempt using Magento connect (via SSH) failed, The following error appeared when trying to load the site

“Call to a member function rewrite() on a non-object”

After googling the error and trying a few suggestions the install was still broken so I restored from backup and tried again. This time I followed the following steps

1. Remove cached files from /var/cache and /var/session

2. Restart memcached (if being used)

3. Sync mage


./mage sync

4, Run upgrade (with force switch)

./mage upgrade-all –force

5. Reset ownership and permissions on all files and folders.

Magento loaded without error.

There are no major database changes between and so you can restore your 1.7 installation and switch between the two versions quite easily if you need to do any debugging etc.


Magento HTML Invoices, Print, Save, PDF

A Magento invoice display and printing system using PHP that can run externally to Magento.

The application displays Magento orders based on a time range in days and lets you display or print them with one click.

You can select a range of orders and preview the invoices, or print them by clicking on each order to select it. and clicking the print button.

Acknowledged orders (printed orders) are recorded and shown with a print symbol next to the order. (requires a configured cache folder writeable by www user.)

Click the time range to change the order time range in days. Some customer data can be edited directly in the app and exported to a text file which can be useful for automatic imports to shipping software etc.

Invoices can be displayed in the language they were placed in – simply create a translation file for your language and configure the application store id’s and languages.

Tested with
Chrome and Firefox – IE9/10 has some issues with printing.
Magento 1.3x – 1.7x (Community Edition)

Source code –

Copy the source files to a web accessible folder and configure settings in the configuration files. Point your browser at the installation folder to view orders.

BETA Demo below NOTE – no application security has been included, you should secure the application folder with Apache or implement a PHP login system. Installing the app in a public folder will give public read/write access to your Magento data!