Magento – Adding custom variables to Magento Static Blocks

I’ve been asked to customize the front page of a magento store. The client wanted the ability to specify a set of variables that can be used in CMS static blocks so static blocks can be a little more dynamic.

By default, the standard magento CMS static blocks don’t provide access to the custom variables. so I thought I was going to have to build an extension to pass the variables in. However after a little bit of finding, I found that this functionality is available as standard in Magento, you just need to do it properly.

Continue reading

.gitignore generator for Magento

Git is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows. it’s important for many projects and Magento is not an exception. for many beginners or even experienced developers, a good .gitignore file is not always in their mind, this is source of many sins in the future to other developers who get in the line of the same project later.

i created a bash script and have been using it for awhile. You can generate a good .gitignore file from now on and stop worrying about git related issues in the future. you can find the script below

Continue reading

Magento – Clean database dump for development purpose

cleaning database

Mangeto Database is huge and complicated, everyone knows about this truth. It’s a big obstacle for many developers who start working on a new project or grab latest changes on production server. The following procedure will help you to reduce size of production database a lot before downloading to you local environment.

Continue reading

Magento – Remove redundant attributes


Some time Magento redundant attributes can be very harmful. for example, AheadWork shop by brand will add aw_shopbybrand_brand attribute to catalog_product, it’s ok when you still use AheadWork module but it can be a big trouble like fatal error on server or producing error messages in your log file when you replace it with another extension. This issue happened because you just removed AheadWork module code from your Magento installation, aw_shopbybrand_brand attribute is still stay in your database. in this article, i will show you a setup script that will remove it.
Continue reading

MySQL general error – 2006 MySQL server has gone away


Does this error message scare you ?

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Today we will take a look at it and find ways to deal with it 🙂 . after investigating the issue and google it online, i founded two most common reasons (and fixes) for the MySQL server has gone away (error 2006) are:

Continue reading

Magento – Installing Extensions via Command Line


I don’t like the idea of having to change permissions of my magento install to add on new extensions. There’re some services that allow you to download extension in compressed file like , so you will only need to extract then copy&paste to your Magento installation folder, this is also a pain to me, especially when i’m on a Mac (yes, Mac is bad at merging files) . Thanks to Magento, we have command line for this type of work.

Continue reading

Magento – Optimize your webshop


Recently, i have many works that focus on Magento optimzation, that explains why i have many optimization related articles stay close to each other :D.

Today i’ll introduce you another techniques belong to Magento itself, it means you can do it with only source code and admin dashboard. there’re two sections, first one is about configuration, and second one is about frontend. i hope you will enjoy it.

Continue reading