Modules

Debugging Magento Controller 404 Errors

This article will describe the steps to take when debugging Magento controller 404 errors, specifically those that occur when attempting to override an existing Magento controller within a custom module.
If you are looking to override a frontend controller, let’s say AccountController.php of the Mage_Customer module, the configuration within your custom module’s config.xml might look …

Packaging Magento Extensions

When going through the Magento extension submission process within the Magento Marketplace, you are required to upload an archive file of your extension files. Packaging Magento extensions can be performed within the admin panel under System -> Magento Connect -> Package Extensions.

On this page, there are six tabs situated on the left hand …

Extending a Third Party Module in Magento

Adding Magento modules give us the ability to extend the default functionality. Sometimes when developers are attempting extending a third party module in Magento, their changes are overwritten when the module is upgraded.
This is usually because changes are made within the third party modules themselves and not within a module that extends them.
Even …

Fixing Invalid Block Type Errors in Magento

One of the reasons why Magento’s system and exception log files get filled so quickly is due to repeated errors being generated when the Magento application loads on each page request.
One of the most common errors seen is the ‘Mage_Core_Exception’ with message ‘Invalid block type: [block] error. This error occurs when Magento tries to …

Magento Data Scripts

Magento data scripts that are located within the modules’ data directory were introduced in Magento Community/Open Source version 1.6.
The naming convention for the data script files have a similar naming convention to setup scripts that are found within the modules’ sql directory.
The data file names themselves are proceeded with a data- prefix.

Magento Create Block

This article will look at how Magento generates and creates its blocks from reading the layout configuration within its layout files.
If you haven’t already seen how Magento gets its layout config, it is recommended to read the Magento Load Layout article.
The generateBlocks() method is a good starting place to look at within the …

Magento Rewrite Blocks, Helpers, Models and Controllers

As well as Magento giving us the ability to add custom blocks, helpers, models and controllers, we also have the ability to safely rewrite these existing classes without affecting the Magento upgrade process or security patches that may overwrite some of these files.
If you haven’t already read the article about adding custom blocks, …

Magento Add Cron Job

This article will assume that you have already set up the cron.sh or cron.php file on your server’s crontab and is successfully running.
By default Magento has a list of cron jobs that execute at certain frequencies. Examples would be Magento’s Google sitemap generation, or cleaning up log files. If you haven’t done so, it …

Add a Magento Observer

This article will demonstrate how to add a Magento observer where you have the ability to hook onto an in-built Magento event or onto a custom event of your own.
If you haven’t already read the Magento Dispatch Event article, it would be a good idea to familiarise yourself with Magento’s Event Driven Architecture.

Magento Custom Block, Model, Helper and Controller

This article will demonstrate how to add a frontend Magento custom block, model, helper and controller. For the purpose of this article, we will ensure that our module will be accessible via the somemodule/index/index route.
On this page we will also add a custom block and template that will return some data from the …