Archive for 'Module'
Bestseller module (with Toolbar!) – Magento 1.2.1
Posted on 07. Feb, 2009 by Fido .
How many people were disappointed to install Magento's test data and find out that the home page "Best sellers" was just pain HTML placed into the CMS home page? I certainly was one of those people. That's why I decided to create a Bestseller Module that was dynamic and harnessed the power of Magento's built in features. This post shows you the code and gives and explanation of what is happening.
Continue Reading
What’s in a block? – Some Magento “basics”
Posted on 22. Jan, 2009 by Fido .
Many developers are familiar with the MVC (Model View Controller) design pattern that is seemingly ubiquitous throughout web frameworks. Looking through the code in Magento, however, we see many other components besides the M's the V's and the C's. Each module (a "module" meaning the separate directories within the "app/code/core/Mage" directory that comprise of Magento's different functional areas) contains the usual Controller and Model. You'll see that within each module, there are no Views (more on this later). You'll also see extra tidbits, such as "helper" , "etc" and "sql". These are (and are not) standard within the Zend Framework context and will not be discussed in this article. In these modules are also the sort of files which we work with very often. The all powerful block! This article will attempt to (hopefully accurately) describe just what a Block is and how it's used.
Continue Reading
Some custom Blocks to help you show products
Posted on 07. Oct, 2008 by Fido .
I have a few custom blocks I've written / copied and tweaked from various posts on Magento's forums. I noticed they are pretty universal in how they grab, filter and return a product collection to be used in various template files (.phtml files). The blocks below should all work from List.phtml (app\design\frontend\default\default\template\catalog\product\list.phtml).
Continue Reading
How to override a Magento core block class
Posted on 17. Sep, 2008 by Fido .
This tutorial will show you the proper method for overriding a Mage core class. This will work for Block and Model classes. Controllers are a slightly different story and for another tutorial. Some discussion on breadcrumbs: I will be overriding the Core file: app/code/core/Mage/Catalog/Block/Breadcrumbs.php (which I will call [Breadcrumbs-B]). This file is not to be confused with the block: app/code/core/Mage/Page/Block/Html/Breadcrumbs.php (which I will call [Breadcrumbs-A]).
Continue Reading
Create a simple custom module
Posted on 11. Sep, 2008 by Fido .
Part of customizing Magento is, of course, creating custom Modules. These allow you to inject functionality anywhere, whether in a "static" block fashion that's more than static, or a shipping/payment module, or large module to do something as large as integrating a 3rd party system (or multiple systems). There are many things custom Modules can do, from editing your Database, to handling module upgrades to overriding classes (Blocks, Controllers, Models) ... and more!
Continue Reading
Quick debugging tip
Posted on 03. Sep, 2008 by Fido .
You can add items to magento’s system log and exception log in your code. This is very handy for pin-pointing coding errors / problems. Developing for Magento is often hard, especially since it’s not always possibly to have error reporting on (and even when it is on, its hard to find exactly what’s wrong!). Here’s an [...]
Continue Reading
Using PHP code on a CMS page (custom Block/module)
Posted on 02. Sep, 2008 by Fido .
If you have ever wanted to do some sort of PHP processing within a CMS page that you created, here is how you do it. A limitation of this tutorials is form processing. That involves creating and/or extending and/or overriding a controller class (which I'll save for another day). This code will allow your code to accept arguments, making it handy for some sort of dynamic use!



