You are viewing an old revision of this post, from February 27, 2015 @ 11:54:44. See below for differences between this version and the current revision.

How to disable email sending when programatically creating an order in Magento

Here is a little snippet of code that can come in handy if you are like me handling a task of programatically creating an order in Magento. My issue was that I had to disable emails beeing sent out to the customers, while at the same time leave the normal frontend process. Thus I could not just go under Magento admin System > Congifuration and disable email sending from there.

Here is the sample line code you just need to place above final $order->save() or possibly $checkout->saveOrder():

Mage::app()->getStore()->setConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_ENABLED, "0");

Revisions

  • February 27, 2015 @ 11:54:44 [Current Revision] by admin
  • February 27, 2015 @ 11:54:44 by admin

Revision Differences

There are no differences between the February 27, 2015 @ 11:54:44 revision and the current revision. (Maybe only post meta information was changed.)

No comments yet.

Leave a Reply