Observers and Dispatching Events
As stated in many previous posts, it is not a wise idea to modify core code. There are basically three ways to extend/change the behavior of Magento and since copying Mage files down into the local code pool is the last resort, and we have already talked about rewriting, I thought I would try my [...]
Read More...Debugging Magento Step by Step
Although these debugging tips can be applied towards any LAMP application (for the most part), we wanted to give a more narrowly focused step by step debugging checklist for Magento. Get XDebug or ZendDebugger Working I, personally, don’t know how anyone can develop effectively outside of an IDE (mine being Eclipse PDT), or without a [...]
Read More...How Blocks And PHTML Work Together
Early on in my Magento-coding days, I struggled with the relationship between the block classes and the phtml files. Which came first? Who owned who? Do you need blocks? Do you need phtml? First and foremost, we need to understand that the complexity of the layout/block/phtml relationship is necessary, powerful, and flexible. Those three pieces [...]
Read More...Joining An EAV Table (With Attributes) To A Flat Table
If you have created a “custom” flat table that has a foreign key to an existing Magento EAV table, you might come across the need to join the two together. If you main table is the flat table, you will find it difficult to join the two using existing Magento code. Below is a snippet [...]
Read More...Debugging Translations
When your store is dealing with multiple translations, sometimes you just want to see a list of which translations are coming from what modules. Magento doesn’t offer a way to get this information without editing the core, so what I am about to do should only be done for debugging and then removed. First, located: [...]
Read More...Rewriting Or Rerouting A Controller
Just as with models/blocks/helpers, there are times when we want to change the way a core Magento controller works. Since we DON’T EVER WANT TO CHANGE THE CORE, we need a way to tell a request to use OUR controller instead of Magento’s controller. We do this by changing the configurations that hold the routing [...]
Read More...Rewriting a Helper Class
The ability to rewrite classes are a super valuable tool when you want to extend the business logic of Magento, or make tweaks to the core. And since we have already talked about rewriting models and blocks, lets talk about helpers! For a third time, I will state that you SHOULD NEVER CHANGE THE CORE, [...]
Read More...Creating Custom Magento Reports
This post is going to be LONG. And not fun. To be honest, I’m not sure how some of this stuff works, but I do know that I have successfully created two different kinds of reports. Some things to note: You should never create reports off of a transactional table. Running the report could potentially [...]
Read More...Magento Examples, Blogs, and Tutorials
Magento tutorials are lacking, as are Magento examples and Magento blogs. This being the case, we started this site to help any/all Magento developers to be more proficient in Magento coding, we wanted to put out a brief list of sites that offer the same type of help. Quite obviously, the best is CodeMagento.com, but [...]
Read More...The “Model” Family
With any framework that follows MVC, you should find a place where models are defined, along with some form of the “resource model”. In Magento, you will find three members of the “model” family. The Model, the Resource Model, and the Collection Model. All three members of the family work together to get us the [...]
Read More...