Adding New Magento Cache Types
Adding New Magento Cache Types A simple configuration recipe for adding new cache tags to the Magento backend’s “clear cache” feature.
astormBack in they day, I ran a Tumblr blog named Magento Quickies where I’d post shorter, less in-depth posts about my travels through Magento’s source code. This Programming Quickies categories is the successor to that Tumblr blog. You’ll find all the old Magento Quickies content here, as well as new short posts about programming in general.
This section has its own RSS feed, the old Magento Quickies feed should should be redirecting, and we’re cross posting notifications for new posts over to magento-quickies.tumblr.com. In other words, you shouldn’t need to know any of this, but the duct tape that keeps the internet held together isn’t aging well, so your mileage may vary.
Below you'll find all the Programming Quickies articles on the site, followed by a chronological listing of the same. You may also browse the 7 series directly via the following links. Pestle, Four Steps to Async Iterators, Checking in on OpenMage and Magento in 2020, Text Encoding and Unicode, Shopware's Development Environment, A Sentimental Gen-X Programmer Culls his Tech Books, and, Containers, Containers, Containers.
Adding New Magento Cache Types A simple configuration recipe for adding new cache tags to the Magento backend’s “clear cache” feature.
astormThere’s no official Magento “startup” event, but the first “safe” event to listen for in Magento is probably the controller_front_init_before event. I say probably, because there are a few events that fire prior to this one. In a stock installation of Magento 1.7 these events are resource_get_tablename [...]
astormCart Related Magento Events Ben Marks chases down the white whale of Magento cart events.
astormDeleting Product Images Programmatically A Stack Overflow answer covering how to delete an image from a product via PHP code. It’s also a good example of using the business logic encapsulated in API resource models without the overhead of SOAP, XML-RPC, REST, etc.
astormWhen is a Template not a Template? Just because a block has the word “Template” it its class name doesn’t make it a template block.
astormCan’t Login to the Admin I coughed up every reason I could think of for Magento infamous (it means more than famous!) admin login bugs.
astormAre you customizing the main product view page? Don’t forget to check that your updates render correctly on the product edit page as well. Add an item to your cart and then click the “edit” link. That’s a different page (front name: checkout_cart_configure) that might be loading different blocks, javascript, etc.
astormAdding Arbitrary HTML to Magento’s I know you’re all HTML5 frontend whizzes who plan their CSS and Javascript meticulously and drive out anyone who would even think of slipping a quick CSS rule or Javascript snippet into their document head, so I include this only out of completeness.
astormPosting this to archive a twitter conversation between Vinai Kopp and myself. I’ve long wondered what the naming conventions were for variables in Magento’s phtml template files. Many templates use the $_underscore convention for all their variables. Other templates don’t. People have speculated that Magento is warning [...]
astormInstalling APC on OS X Good roundup of the hoops you need to jump through to get PHP APC up and running on OS X (from Doug Sparling). See also Optimizing APC Cache Settings for Magento, and Magento / Zend Framework’s TwoLevels Cache Backend Mess.
astormHard to believe I haven’t mentioned this one before, but if you’re going to be doing javascript development in Magento, you’ll want to look in the following file js/varien/js.js and comment out or nullify the following code if (!("console" in window) || !("firebug" in console)) { var names = ["log", "debug", "info", [...]
astormAlthough the latest version of Magento offers the ability to control how PHP caches the SOAP server’s WSDL file, and my own Mercury API extension offers similar functionality for older version of Magento, sometimes the WSDL caching can still bite you in the butt. While the above features control the caching at the server level, if [...]
astormWidget Data and How Hard Can It Be? This Stack Overflow question is a nice example of how something that seems simple (querying for and updating a widget instance’s data paramaters) can be harder than you think. Most Magento projects go off the rails because someone assumes something like this is easy, and then modern company [...]
astormRewrites for Resource Models (include collections) Rewriting a resource model in Magento can be tricky business. This Stack Overflow answer covers the how and why.
astormIs this Cached? A Stack Overflow answer where I run through the steps I take to determine if there’s caching logic around the “Custom Variables” feature.
astormIf you’re having trouble with a call like echo $this->getChildHtml('foo'); returning an empty string, add the following debug code to your template var_dump(array_keys($this->_children)); This will print out all the children of the current block. If you don’t see the block you’re trying to echo above, that means [...]
astormNothing dredges up fear and loathing in an e-commerce developer like the phrase so we’ll just add [—] to the order success page That’s because testing any changes to this page requires a full purchase flow. Most web developers work in a “type, save, refresh, examine, oops, type, save, refresh” mode, and the idea [...]
astormFully Automated Magento Install Script I haven’t had time to check it out, but the Sonassi folks have shared their build script for rolling out a new version of Magento. I think we all have something like this sitting on our harddrives, but I know mine is sort of janky so I’ll be checking out the Sonassi version right away.
astormMore strange behavior in Magento due to EE’s new Mage_Persistent module
astormWhen is Data set in an XML Update Available in a Block
astorm