It appears future came for us Magento developers in the end. Magento 2 platform is alive and kicking, and with it modern PHP tools like Composer entered our daily routine. And it's so much easier now the Composer is here to take care of my dependencies! Khm. Not so fast. To be honest, packaging software into neat fully decoupled packages is still a utopia. We model tightly coupled reality which is not something you can hide behind package manager. Nevertheless, there are some neat concepts behind Composer and Magento 2 working together, lets check it out.
Continue readingTag Archives: PHP
Blank product page with Magento compilation enabled
Before we seriously step into Magento 2 era, please allow me to dissect one more Magento 1 bug. Couple of weeks ago we enabled compilation at one of our client's Magento EE installation as a part of holiday traffic preparations. Goal was to take advantage of performance boost provided by avoiding Magento autoloader through compiling all the Magento classes into several bulky PHP files. Unfortunately things didn't go to plan and we had to disable compilation couple of days later, due to bug in the way catalog product view controller handles 404 forwarding when product exists, but for some reason it isn't viewable (out of stock, disabled, etc.).
Continue readingHole punching with Magento Enterprise Edition full page cache
In my last article on this topic I explained how Magento Enterprise Edition Full Page Cache works, and how to use performance boost it provides at your own controller action. In the second part of this mini article series, I will try to explain concept of Enterprise_PageCache containers used for allowing dynamic behavior for certain blocks, even though page is served from full page cache.
Continue readingCatalog price rules not applied when creating order from Magento admin
Even though I'm in love with the platform, as it turns out, I tend to blog about Magento bugs quite often. I like to believe this is a good thing, because besides helping other Magento developers, finding and fixing bugs makes our favorite ecommerce platform better. It has nothing to do with frustration couple of days debugging session can cause, I ensure you. In this article I'm about to explain and provide workaround for bug affecting all Magento versions (including latest Magento CE 1.9.0.1 at the time of writing), one that's causing catalog price rules not being applied to final price and totals not getting calculated correctly when creating orders from Magento admin, all this under specific and hard to reproduce circumstances. Honestly, this is probably the ugliest bug I've ever seen in my coding career, largely due to fact that client's bug report is usually that catalog price rules prices revert when creating orders from Magento admin, but only sometimes and without any pattern.
Continue readingRouting in Magento - tracing single HTTP request
Routing is an essential part of every MVC, Magento is not an exception to this rule. In order to understand how Magento routing works, it is necessary to get acquainted with execution flow that leads to certain request getting (or not getting) dispatched. It goes without saying that this knowledge comes in handy when you need to explain that 404 being thrown.
Continue reading