Modify “Interface locale” dropdown in administration

Posted on May 11th, 2011 | Posted by admin

It is really cool when you can see large list of languages in the footer of Magento administration. You might think that all those languages you can see are available by default, but that is not the case. What to do when you need only two? English and Spanish for example? What seamed to be a simple task, turned up to be quite challenging.

Mage_Core_Model_Locale_Config has protected property $_allowedLocales containing array of locales that will be used to show language dropdown.

I have failed to rewrite that class, but that would be bad idea anyway, mostly because I don’t have time to spend half day testing if that has any sideefects that I’m not aware of, so here’s what I came up in the end.

Dynamic grids anyone?

Posted on May 10th, 2011 | Posted by admin

For my second :) article I’m again writing about Ext.js. Ext.js has one great part for showing data – grids. These look really nice and you can style them pretty easily. It all works like a charm when you’re using them for static data. But what when things get dynamic? What when you don’t know the number of the headers that you need in the table and not just rows? Here’s where this article will help.

First lets input some data to our view(i used ajax requests). For the request I modeled my json so it has several parts: fields-name of the fields in table, results – data to be shown, and flag – is it input data our output(i had to make a sort of a spreadsheet where input and output data had to be separated.)

Programmatically change Magento’s core config data

Posted on May 10th, 2011 | Posted by admin

Every Magento installation has certain core configuration data already set. When you update those values from the administration interfaces, changes are saved mainly to core_config_data database table. It seems important and something that you shouldn’t touch, right? As always, there are times you will wish to get your hands on it. In some cases you will wish to chance settings directly from the code. This article demonstrates the proper way.
Let’s say we want to change “demo store notice” (on/off) – change value from 0 to 1 and vice versa.
All you need to do is open your database,
for example with phpmyadmin,
browse table “core_config_data“,
change the data you want and save it…

Merging JavaScript in Magento

Posted on May 10th, 2011 | Posted by admin

This is not very tehnical article and most of you already use this feature, however I have noticed that there are many shops that are not using Magento’s default feature to merge JavaScript files. At the time prior to Magento 1.4, JavaScript merging was included, however it was limited to 10 files. Now that’s not a case anymore.

Setting up Magento on Git repository

Posted on May 9th, 2011 | Posted by admin

Hello everyone! Recently I wrote a short article  Git vs SVN A.K.A. Everyone likes control. Now, I wanted to give you an “real life” example of putting Magento project into Git repository.

So, let’s begin. First of all, I assume that you wish to start with fresh project and that you’ll be doing only back-end programming. This is important because I’ll set up repository only for /app/code/local/ folder. It will keep the repository lightweight and enough for this practical example. At the end, I’ll explain .gitignore file so that you can make modifications to folders you wish to include.

Preparing Git locally

There are two steps you must go through before you start working with Git:

  1. To get started, you need to install Git on your machine – you can find instructions by going on this page.
  2. Next thing you need to do is to find yourself a Git repository that you’ll use for your projects. For this example, I used free private repository located at