Widget 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 [...]
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
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
How To Rewrite a Model Answer on Stack Overflow
astorm
Upgrading via. Magento Connect A terse, but useful, Magento wiki page on using Magento Connect’s command line to upgrade your Magento installation.
astorm
The public Magento Wiki is a mess of mixed content, but it’s worth subscribing to the RSS feed of recent changes. The more dedicated members of the community tend to keep their articles up to date on changes to Community Edition, and it can sometimes save you from being blindsided when considering a new version.
astorm
You’re cruising along, your module has come together. The last step between you and total Magento Connect domination is packaging your extension. You bravely enter System -> Magento Connect -> Package Extension, and with victory in your grasp … FAILURE! With no clear path forward, you commit seppuku rather than face [...]
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
From the standard router class in Magento. /** * @deprecated * @see _includeControllerClass() */ protected function _inludeControllerClass($controllerFileName, $controllerClassName) { return $this->_includeControllerClass($controllerFileName, $controllerClassName); }
astorm
There’s more sophisticated ways of logging and profiling SQL in Magento these days, but sometimes it’s still easier and quicker to drop down to the abstract Zend adapter and log your queries with a few discrete calls to Mage::Log Almost every INSERT, UPDATE, SELECT, and DELETE goes through the methods in [...]
astorm
Sending Magento HTML emails Programatically
astorm
Magento’s form validation seems scary at first, but using it is actually quite easy. First, create for your form. <form action="<?php echo $this->getUrl('/some/route/thing');?>" id="theForm"> <input type="text" name="foo" id="foo" /> </form> Next, run this bit of javascript to turn your plain old form [...]
astorm
Lots of kind souls helped me out on Twitter with this one. Some versions of Safari are stricter about setting cookies than others. Also, Magento sets the full cookie domain and path as well, which is where weird cookie bugs can lie. If you’re having trouble setting your session Magento (i.e. “Please Enable Cookies, you [...]
astorm
Magento Version: 1.5.0.1 I’m not sure when this feature was added. It’s there in 1.5.0.1 and might be in previous version. The phtml template file for your system emails are located in app/locale/en_US/template/email/ However, you don’t want to edit these files. Instead, go to System -> Transactional Emails This UI [...]
astorm
sales_model_service_quote_submit_before, sales_model_service_quote_submit_success, sales_model_service_quote_submit_after. All of these are in Sales/Model/Service/Quote.php in submitOrder() method. Zoran Lazarevski, when asked What event(s) are you using to “do something” after checkout/order-creation, regardless of method?
astorm
I use the event ‘checkout_submit_all_after’. Yes the order has been saved by the time this event is fired. Jason Evans, when asked What event(s) are you using to “do something” after checkout/order-creation, regardless of method?
astorm
There is no sure method except sales_order_save_after, but generally I tend to use sales_model_service_quote_submit_after. It covers opc, api and adminhtml (but not multiaddress). sales_convert_quote_address_to_order covers all, but I don’t like it. Vinai Kopp, when asked What event(s) are you using to “do something” [...]
astorm
Magento Version: 1.5.0.1 We’d just done a simple product import, and everything in the front end of the cart looked fine. There was one problem. When we browsed to the admin, no images showed up in the Catalog -> Manage Products -> Images. It turns out that the catalog/product object has a few redundancies when it comes to [...]
astorm