One of the most bewildering missing features I have come across in Magento is the inability to look up orders by ordered products. There are occasions where this feature is sorely needed. For example, you may discover a product needs to be recalled and need a list of every order in the past month containing that product. I discovered I wasn’t the only soul begging for this feature. There is one solution posted which worked but had a few problems. To be precise, it breaks the pager, it replaces a core file and filtering doesn’t work. So, I’ve fixed the major problems and packaged and released it as a free module on github!
This module adds a column to the orders grid which displays either the product name and ordered quantities or the product SKU and ordered quantities which is configurable under Sales > Orders Grid Products Column. The one not selected to be displayed will be added to the title attribute so it can be seen with a mouse hover. The column is filterable by either the product name or SKU depending on the configuration.
I recently updated Module Manager (first post) to support nested modules and renamed the
.modman definitions file to simply
modman for easier editing in IDEs. To top it off I am officially releasing it to the public under the Apache License 2.0 so that you may start using it in your own projects.
Additionally, Module Manager now has it’s own home on Google Code so check it out! (pun intended)
Here is an example of the new nested modules feature:
# My template files
# Import Colin_HotDealz module
Added nested modules, renamed .modman file to modman, released under Apache License 2.0, and hosted on Google Code.
This project was inspired by my recent Magento development work so I’m not sure how much application it has outside of that, but if you’ve ever wanted to use svn:externals with individual files (you can’t btw) then this is the next best thing (and therefore the best thing). Perhaps some other VCS supports this functionality natively , if you know of it please clue me in. I’ve used git and bazaar but still like the simplicity of subversion for small, non-distributed projects.
Magento’s source code is split among several different groups of files: code, design, locale, skin, libs, etc (as in config), etc.. (as in etcetera)
You really cannot avoid ever having to mix a file in here or there which means svn:externals won’t cut it. Besides, svn:externals won’t let you make one commit from all of your externals so to commit your changes you have to do it once for each folder which makes your commit history nearly useless. Enter “modman”, my Magento module manager. While it could be used for deployment it is primarily geared towards developers. Here is how it works:
Update: Bug fix
It turns out that when layered navigation indexes are refreshed the
website_id is 0 which causes the filtered results to be empty which makes layered navigation disappear. The fix is to simply place an if statement around the filter dependent on the website id no being 0. The Magento Connect module has been updated with this fix (0.3.1).
Ok, I think this will finally be the last update to this module… I’ve learned a lot about Magento since the first version of this module, and think I finally did it right this time. This update adds support for advanced search (thanks saho for the bug report) and also every other aspect of the store I could find.
See the latest post in this series: Yet Another “Hiding Out-Of-Stock Products” Update, for an update that fixes advanced search, tags, up-sells, cross-sells, etc..
Updated once again to add support for filtering search results. (Added CatalogSearch/Model/Layer.php, moved Model/Layer.php to Catalog/Model/Layer.php, updated config.xml)
My previous post about “Hiding Out of Stock Items in Magento” had one pretty major downfall, in that it did not handle the product counts in the layered navigation. In response to a forum post regarding this I looked into fixing my original solution and have come up with a more concise and complete approach which I present now as a replacement to my original InStockOnly module.
This module has been replaced with one that correctly updates the layered navigation counts. See the new version here.
The in-stock-only module now works properly when multiple websites are in use.
The in-stock-only module now works with configurable products.
Magento has several criteria for determining if an item should be visible in the store, but one of these is not whether or not the item is in stock. Magento can manage your stock and will set your stock status to “Out of Stock” for you, but what if you want these out of stock items to be hidden from the store.. automatically? Also, in my case I do not want to “disable” the item because the inventory management system will then ignore it. Turns out this was much more difficult to figure out than I expected it to be but the end solution was quite simple.
There is a little conflict in terms here because “modules” are not the same to Kohana as they are to Zend Framework and Yii Framework, which both have support for modular directory structures. In Kohana, modules are like plugins to the framework which can change or add functionality to the core to be made use of in the application. The “Conventional Modular” Directory Structure in Zend Framework is a configuration option, and modules are more like sub-applications; essentially just a neat way to organize various components of an application.
Today I’d like to present my own rendition of an Event Delegator class based on Prototype. Event Delegation can be used to improve performance and code simplicity by observing one parent element and triggering events on the children when applicable rather than observing each child element individually.
While working at Seelab at The University of Tennessee in 2006 one of my first tasks was to rename every function in what is now the Visualization CookBook, but was previously another name. We developed a simple Document for API Modification and called it the DAM document. I then wrote a Perl script to apply the DAM document to user’s source code to ease the pains of a major API modification and we named it “DAMit”. Yes, we too thought it was funny.
Due to a recent request about my Ajax.DoubleCombo class, I have updated it to support automatic updates trickling down when the server returns a “selected” value or the default value is non-void. In the process, I added some Prototype 1.6 custom events, namely doubleCombo:update and doubleCombo:clearSlaves which in turn added support for what I will call “branching”. That is, support for multiple slave selects at each level. I don’t know if anyone has a use for this but it is now supported…
Here is the page with the code, docs and demo: Ajax.DoubleCombo