This one is for me, since I seem to forget Magento’s query binding syntax every time I stay away from it fore more than a week. $sql = "select foo from bar where baz = ?"; $query = Mage::getSingleton('core/resource')->getConnection('core_read') ->query($sql,array($value)); while($row = $query->fetch()) { var_dump($row); } [...]
astorm
Grabbing an Order’s Shipments Includes a terse explanation of my heuristic for figuring out how to find something in Magento.
astorm
Magento Version: 1.5.0.1 More modern version of Magento have abandoned the EAV storage method for sales order information. Don’t worry, there’s still plenty of linked tables to trip you up! One of the most common misunderstandings I’ve seen is that there’s two tables that store primary order information. The more [...]
astorm
We're in the middle of a series covering the various Magento sub-systems responsible for routing a URL to a particular code entry point. So far we've covered the general front controller architecture and four router objects that ship with the system. Today we'll we
astorm
We're in the middle of a series covering the various Magento sub-systems responsible for routing a URL to a particular code entry point. So far we've covered the general front controller architecture and the Standard Magento router object. Today we're covering the three remaining
astorm
Sometimes when you’re tracking down a bit of tricky Magento functionality, you need to quickly suss out not only what events have fired, but which observer methods are actually listening for the events that fired on a particular request. There’s no elegant way to doing this with Magento, but if you’re not above a little [...]
astorm
Sometimes when you’re tracking down a bit of tricky Magento functionality, you need to quickly suss out not only what events have fired, but which observers methods are actually listening for the events that fired on a particular request. There’s no elegant way to doing this with Magento, but if you’re not above a [...]
astorm
Magento “Tweetorials” Vinai Kopp’s new tumblr blog to archive his Magento Tweetorials. Required reading.
astorm
Adding Config Values directly to XML files
astorm
I hope you're enjoying the Dispatch/Router series we're in the middle of. The last few articles are coming along, and it looks like we'll be able to get through the Admin, Cms, and Default router objects, as well as cover the URL rewriting system
astorm
Moving a Block without Recreating It Based on a twitter conversation with VinaiKopp, I discovered you can pass a block’s insert method a string instead of a block object, and it will use the string as a block name to insert. Looks like you CAN teach an old dog new tricks.
astorm
Last time we talked about what goes on with router objects in Magento's front controller object. Now it's time to dig into the router objects themselves.
astorm
Routing is the heart of every web application framework. Requests flow from the internet to your web application. The routing engine takes the information from those requests and sends it to your code. Then, new information (ripe with oxygen, if we want to stretch
astorm
From the standard router class in Magento. /** * @deprecated * @see _includeControllerClass() */ protected function _inludeControllerClass($controllerFileName, $controllerClassName) { return $this->_includeControllerClass($controllerFileName, $controllerClassName); }
astorm
This isn’t even Magento 101, it’s Magento Middle School, but it accounts for 25% of the questions people email me about Magento. If you want to avoid URLs in the form of http://magento.example.com/index.php/foo/baz/bar and instead have http://magento.example.com/foo/baz/bar Make sure your webserver is setup toead .htaccess [...]
astorm
1.6 resource models in a nutshell 1: Complete rewrite, core resource model class prefixes now seem to be <class-prefix>_Resource 1.6 resource models in a nutshell 2: Fallback to old resource models if rewrite is defined (supported via <deprecatedNode>) 1.6 resource models in a nutshell 3: MySQL specifics removed, new resource [...]
astorm
A quick tip and link on the weird (in PHP land) way the Magento image helpers rely on casting for basic functionality.
astorm
Perils of Caching If you’re trying to reuse Magento block classes that have caching enabled, there’s a few things you’ll want to be aware of.
astorm