Categories


Recent Posts


Archives


php19

Widget Data and How Hard Can It Be?

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

Quick Script to Generate DB Dump

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

Magento Wiki

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

Failed to Save the Package

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

The Orders Table

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

SQL Headquarters

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

Editing Email Templates

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

No Product Images in Admin

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
email hidden; JavaScript is required