Categories


Recent Posts


Archives


magento14

Casting Image Helpers

Casting Image Helpers Image helper objects are tricky. Instead of having a “get image url” function, you cast them as a string to get the URL, or more commonly, let PHP cast them in echo statements automatically. However, if you’re not familiar with PHP’s casting rules, it look like the init method returns a [...]

astorm

Customer Confirmation

This one’s a little un-intuitive. At first. There are times where you’ll want to programmatically check if a customer is confirmed. To do this you’d instantiate a customer object like this $customer = Mage::getModel('customer/customer')->getCollection() ->addFieldToFilter('entity_id','197') ->getFirstItem(); or [...]

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

We have an extension that uses Ajax to change what shipping rates are shown in a weekly date/time grid @webshopapps, in response to my question “Hey magento people, are there are any extensions (free/paid) that add Ajax features to the checkout page?”

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