Magento 1


Layout of your custom controller in Magento?

Layout of your custom controller in Magento?

When you work with custom (your own) controllers in Magento,
either frontend or backend, you will probably also use existing blocks and models or if needed write your own classes.
But what happens if you want to or have exigency to move/remove common blocks?
Can you really “design” your own page view without touching Cascading Style Sheets?

Read more

Programmatically change Magento’s core config data

Programmatically change Magento’s core config data

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.

Read more

Magento LightSpeed Extension – Review

Magento LightSpeed Extension – Review

In the last 7 years of my involvement with web development I have had an opportunity to open a great number of different “boxes“ when looking for web site improvement. After opening these “boxes” things often didn’t seem as it was specified – luckily this is not a case with Magento Lightspeed extension : )

Read more

How to set multiple stores/websites with one magento installation on different domains

How to set multiple stores/websites with one magento installation on different domains

This article will describe quickest way how to use and configure one Magento installation on different domains.
Point here is what do you want to have on that different domains, for example you want to have chosen categories/products on one domain and the other one will be on different language.
First you figure that and then go to configuration.

Read more

Load XLS files into Magento modules using PHP-ExcelReader class

Load XLS files into Magento modules using PHP-ExcelReader class

Recently I had a small problem and it turned out that it wasn’t small as a initially thought. I had to read XLS (Microsoft Excel document) into PHP. After I spent almost 2 hours browsing through internet, I found myself most satisfied with open source project “PHP-ExcelReader class“. It has everything I needed (multiple sheets support and it could read data from both Excel 2000 and 2007). On the other hand, Magento doesn’t support XLS, and I decided to write a small method that you can implement in any Magento class.

Read more

Programmatically create order in Magento

Programmatically create order in Magento

Surprisingly one of the trickiest parts of “under the hood” Magento is how to create order programmatically. At least for me, this was/is the most complex area of Magento development. Reason why it is so difficult is that the order creation process is all but not straightforward. You cannot simply instantiate order model, set some data and call upon the save() method. If you ask me, this is how it should be done.

Read more

Magento and Google Adwords conversion tracking

Magento and Google Adwords conversion tracking

If you use Google Adwords advertising for your Magento web store, you will probably need this module. This module will be very useful, because Magento doesn’t have functionality for tracking Adowrds conversion. Feel free to download module and use it on personal responsibility. I’m using this module on web store without any problems.

Read more

How to make order shipment from code

How to make order shipment from code

As most of you know, there is an Order interface in Magento administration from where you can trigger order shipping. However, while developing certain module, you might wish to trigger this event from the code. I hope that this code snippet will help you in this process. In my case I have used this code to make shipment from cron after I got confirmation from fulfillment center

Read more

Magento Enterprise 1.9.0.0 redirects to home page instead of 404 error page

Magento Enterprise 1.9.0.0 redirects to home page instead of 404 error page

If you have installed and working on latest Magento’s Enterprise Edition 1.9.0.0, you could find some strange behavior with 404 error page and landing page. People say there is a patch for this, but I would like to present a quick fix for those of you who need an urgent solution. Issue is that you’ll get status 200 OK for each non-existing CMS page or controller and you will be redirected to home page.

Read more

How to add massactions to Magento’s grid

How to add massactions to Magento’s grid

This article describes how does Magento’s mass actions work and how to add them in your existing grids.

You need to do 2 things:
– extend the block (grid) class with “protected function _prepareMassaction()
– add an action into your controller, which will handle your desired logic.

Read more

Contact Form in Magento

Contact Form in Magento

As you know, Magento has a built-in contact form that can be used for general contacts. That form isn’t part of any CMS page, you cannot edit some introduction text, you cannot add phone numbers administration, and you cannot see the breadcrumbs. If you wish to edit text in that default contact form, you will need to update front-end files. Luckily, there is an alternative.

Read more

Mysteries of Magento Encryption Key

Mysteries of Magento Encryption Key

If you ever went through Magento installation process, you know that at some point you are asked for Magento Encryption key. Magento will automatically generate one for you if you do not enter anything in this field. For first installation, this is just fine. You will see a note that Magento uses this key to encrypt passwords, credit cards and more. Is this really the case?

Read more

Programatically create attribute in Magento, useful for the “on the fly” import system

Programatically create attribute in Magento, useful for the “on the fly” import system

Sometimes when doing an import in Magento from old shop system you are faced with lot of issues related to attributes. For instance your old shop system might have several product attributes that simply do not fit into the default Magento attributes. In such cases you need to create these attributes manually in the Magento admin, assign them to the appropriate attribute set and then construct a valid CSV file with valid column names for these new attributes.

Read more