Speeding Up the Magento Checkout (Save Order Action)
Recently I’ve stumbled across a few tricks that may help you speed up the checkout process in Magento – specifically the final section where you save your order. The problem with the save order action in the checkout is that is needs to run through a list of observers, complete each observer function and then redirect the user to the payment gateway/thank you page. By removing a few of these observers you can greatly speed up the checkout process – especially when an order is very large (for example bundle products).
What we are going to do is find the observer that are not commonly used in Magento and disable those which you may not be using. In the example below I have turned off the observers for “notify stock” (client not using Magento stock system), “downloadable products” (again not using downloadable products) and perhaps the “rss notice” which seems to be tagged as “ordernew”.
In order to turn off the observers in a Magento-Friendly way you should create a new module so follow the steps below:
Create new simple module structure so create:
<?xml version="1.0"?> <config> <modules> <Creare_Disabledobservers> <active>true</active> <codePool>local</codePool> </Creare_Disabledobservers> </modules> </config>
<?xml version="1.0"?> <config> <frontend> <events> <controller_action_predispatch> <observers><log><type>disabled</type></log></observers> </controller_action_predispatch> <sales_order_item_save_after> <observers> <downloadable_observer> <type>disabled</type> </downloadable_observer> <notifystock> <type>disabled</type> </notifystock> <!--<ordernew> <type>disabled</type> </ordernew>--> </observers> </sales_order_item_save_after> </events> </frontend> </config>
That should do it! Notice I have commented out the ordernew disable – this is because I’m not 100% confident that it only affects the RSS new order feed – however this one does have the greatest impact on the speed on the transaction. In order to be 100% confident you can double-check by commenting out the observer from within the code>core>Mage>Rss>etc>config.xml so it looks like the following:
<observers> <!--<ordernew> <class>rss/observer</class> <method>salesOrderItemSaveAfterOrderNew</method> </ordernew>--> </observers>
Obviously this is a core edit so make sure you try and bring it back into the module – would be interested if someone could confirm the module does actually only affect this rss observer though . Thanks for visiting!