Magento Themes and Magento Extensions

Dynamic grids anyone?

Share
Posted on July 1st, 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.)

Since I used Array store I modeled my data into an array.

Modify “Interface locale” dropdown in administration

Share
Posted on July 1st, 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.

How to extend Magento Order Grid?

Share
Posted on July 1st, 2011 | Posted by admin

Here is small example which explains how to modify order grid. Main class for order grid is “Mage_Adminhtml_Block_Sales_Order_Grid”, if you want to add some column you have to rewrite this class (block).

How to rewrite magento block:

1
2
3
4
5
6
7
<blocks>
<adminhtml>
<rewrite>
<sales_order_grid>Inchoo_Test_Block_Adminhtml_Order_Grid</sales_order_grid>
</rewrite>
</adminhtml>
</blocks>

Programmatically change Magento’s core config data

Share
Posted on June 30th, 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“,

Merging JavaScript in Magento

Share
Posted on June 30th, 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.

All you need to do is:

1) Go to admin section
2) Go to System->Configuration->ADVANCED (Developer)
3) Set “Merge JavaScript Files” to Yes (“No” is default)
4) What left is to Flush Javascript/CSS Cache at Cache management admin interface.

That’s it!