Using assign with Magento Blocks Apparently Magento blocks have an assign method, which produces behavior more like a “traditional” PHP MVC view layer. I was sort of aware of this, but it never really sunk in until @vinaikopp’s tweet. That is, if you use code like this #File: [...]
astorm
Passing Data between Controllers and Blocks Probably old hat for most of you, but repeating a lesson never hurts.
astorm
People often talk about Magento having a "SOAP" API. SOAP is a series of protocols that, from one point of view, is designed to allow programmers to call a function on one computer, and have it executed on another computer. XML-RPC is a simpler
astorm
Magento and max_input_vars The unstoppable @benmarks tweets a warning about Magento and max_input_vars. The further an abstraction removes itself from the underlying technology, the more bugs like this pop up. It’s a common anti-pattern I see in in web frameworks using Java-like OO patterns.
astorm
Every model in Magento has an “array like” collection object. $collection = Mage::getModel('sales/order')->getCollection(); foreach($collection as $order) { echo $order->getIncrementId(); } Each collection also has a convenience method to grab the first or the last item from the collection $item = [...]
astorm
Why Some Blocks Methods don’t Work in Some Templates
astorm
This is a small PHP shell script that will extract the default connection information from local.xml and construct the correct command-line script to do a no-locking dump of the database. You’ll need to be in the root folder of a system for this to work. Useful if you spend a lot of time debugging different systems. #!/usr/bin/env [...]
astorm
Two quick announcements this week. The first is the immediate availability of Commerce Bug 1.5, and the second is the new Pulse Storm blog. I'll still be posting Magento articles and tutorials here on alanstorm.com, but the Pulse Storm blog is what
astorm
If you’ve setup your own API methods and are having some trouble getting the resources to show up in the admin console’s resource list, make sure that each resource ACL group node and each each individual ACL node in api.xml have a module= translation attribute <assign_simple_product_to_configurable translate="title" [...]
astorm
Tracing PayPal’s IPN Callback Request Tasks like this make ecommerce programming the dregs.
astorm
This article is part of a longer series exploring the Magento global configuration object. While this article contains useful stand-alone information, you'll want to read part 1, part 2, and part 3 of the series to fully understand what's going on.
astorm
I had a client who was using the “store code in URL” feature of Magento throughout their site. This was working well for them, but there were a few URLs where they wanted NO store code, and I was asked to look into it. Digging deep into the URL generation code, I discovered the <direct_front_name> node. <global> [...]
astorm
Punching a Hole in Magento’s Full Page Cache
astorm
This article is part of a longer series exploring the Magento global configuration object. While this article contains useful stand-alone information, you'll want to read part 1 and part 2 of the series to fully understand what's going on.
astorm
We hope you're enjoying the latest Magento programming series covering the the global config. Unfortunately, the former core team member we have chained in the basement escaped over the weekend without finishing his latest assignment. We have dogs canvasing the neighborhood and a foot
astorm
Update: Turns out the previous post was missing a <layout> tag in the code examples. This has been fixed, and we regret the error. (Thanks to Bartosz Cisek, proprietor of brillan.pl, for the correction) I was surprised to discover I hadn’t covered this anywhere other than No Frills Magento Layout. The XML files in a [...]
astorm
This article is part of a longer series exploring the Magento global configuration object. While this article contains useful stand-alone information, you'll want to read part 1 of the series to fully understand what's going on.
astorm
How To Rewrite a Model Answer on Stack Overflow
astorm
The getChildChildHtml method A Stack Overflow explanation of the getChildChildHtml method on Magento’s block objects, (as opposed to the getChildHtml method). If you’re up for learning more than you ever wanted about the Magento Layout, my book No Frills Magento Layout is your first step into a larger world.
astorm
Adding External Javascript to Magento’s Head Magento’s head template (in 1.6.1 at least, but probably other versions as well), includes a call to $this->getChildHtml();. When called with no paramaters, this method renders all the child blocks of a template. That means you can add any child block to the head block, and have [...]
astorm