Magento 2 - sales_order_place_after not returning Order IDUnable to get order by increment id in observerExecuting Custom script after placing the order successfully magento 2observer method sales_order_place_after not executingHow to obtain a JSON order rendered by the REST API in the sales_order_place_after event observerModifying product options on “sales_order_place_after” event : modifications unsaved?Magento add custom options to cartPaypal Express sales_order_place_afterSet custom price of product when adding to cart code not workingMagento sales_order_place_after event not workingHow to get order data from sales_order_shipment_save_after eventsales_order_place_after not triggering in magento 2Magento 2: I Want to add multiple product using checkbox
Make a Bowl of Alphabet Soup
Integral Notations in Quantum Mechanics
How do I fix the group tension caused by my character stealing and possibly killing without provocation?
Unable to disable Microsoft Store in domain environment
"Oh no!" in Latin
How would a solely written language work mechanically
I'm just a whisper. Who am I?
Pre-Employment Background Check With Consent For Future Checks
Grepping string, but include all non-blank lines following each grep match
Why is the Sun approximated as a black body at ~ 5800 K?
Why do Radio Buttons not fill the entire outer circle?
If the only attacker is removed from combat, is a creature still counted as having attacked this turn?
Does Doodling or Improvising on the Piano Have Any Benefits?
Is there anyway, I can have two passwords for my wi-fi
Typing CO_2 easily
Ways of geometrical multiplication
What (the heck) is a Super Worm Equinox Moon?
Is it feasible to let a newcomer play the "Gandalf"-like figure I created for my campaign?
Is there a distance limit for minecart tracks?
When is "ei" a diphthong?
Proving an identity involving cross products and coplanar vectors
Echo with obfuscation
How to leave product feedback on macOS?
Can I run 125kHz RF circuit on a breadboard?
Magento 2 - sales_order_place_after not returning Order ID
Unable to get order by increment id in observerExecuting Custom script after placing the order successfully magento 2observer method sales_order_place_after not executingHow to obtain a JSON order rendered by the REST API in the sales_order_place_after event observerModifying product options on “sales_order_place_after” event : modifications unsaved?Magento add custom options to cartPaypal Express sales_order_place_afterSet custom price of product when adding to cart code not workingMagento sales_order_place_after event not workingHow to get order data from sales_order_shipment_save_after eventsales_order_place_after not triggering in magento 2Magento 2: I Want to add multiple product using checkbox
I have created an event for sales_order_place_after
event.
This doesn't return Order Id. However, it returns Increment ID
public function execute(Observer $observer)
$order = $observer->getEvent()->getOrder();
$order->getIncrementId();
$order->getId();
magento2 event-observer sales-order place-order
|
show 1 more comment
I have created an event for sales_order_place_after
event.
This doesn't return Order Id. However, it returns Increment ID
public function execute(Observer $observer)
$order = $observer->getEvent()->getOrder();
$order->getIncrementId();
$order->getId();
magento2 event-observer sales-order place-order
Try to dump out the order datavar_dump($order->getData())
– Khoa TruongDinh
Dec 29 '16 at 10:44
No, it is not working .
– Jancy Abraham
Dec 29 '16 at 10:50
Try to dievar_dump($order->getData()); die();
.
– Khoa TruongDinh
Dec 29 '16 at 11:00
Try with $order->getEntityId();
– Rakesh Jesadiya
Dec 29 '16 at 11:17
2
you can use sales_order_save_after event to get order id
– Rakesh Jesadiya
Dec 29 '16 at 11:37
|
show 1 more comment
I have created an event for sales_order_place_after
event.
This doesn't return Order Id. However, it returns Increment ID
public function execute(Observer $observer)
$order = $observer->getEvent()->getOrder();
$order->getIncrementId();
$order->getId();
magento2 event-observer sales-order place-order
I have created an event for sales_order_place_after
event.
This doesn't return Order Id. However, it returns Increment ID
public function execute(Observer $observer)
$order = $observer->getEvent()->getOrder();
$order->getIncrementId();
$order->getId();
magento2 event-observer sales-order place-order
magento2 event-observer sales-order place-order
edited Dec 29 '16 at 10:41
Jancy Abraham
asked Dec 29 '16 at 10:31
Jancy AbrahamJancy Abraham
1,09111638
1,09111638
Try to dump out the order datavar_dump($order->getData())
– Khoa TruongDinh
Dec 29 '16 at 10:44
No, it is not working .
– Jancy Abraham
Dec 29 '16 at 10:50
Try to dievar_dump($order->getData()); die();
.
– Khoa TruongDinh
Dec 29 '16 at 11:00
Try with $order->getEntityId();
– Rakesh Jesadiya
Dec 29 '16 at 11:17
2
you can use sales_order_save_after event to get order id
– Rakesh Jesadiya
Dec 29 '16 at 11:37
|
show 1 more comment
Try to dump out the order datavar_dump($order->getData())
– Khoa TruongDinh
Dec 29 '16 at 10:44
No, it is not working .
– Jancy Abraham
Dec 29 '16 at 10:50
Try to dievar_dump($order->getData()); die();
.
– Khoa TruongDinh
Dec 29 '16 at 11:00
Try with $order->getEntityId();
– Rakesh Jesadiya
Dec 29 '16 at 11:17
2
you can use sales_order_save_after event to get order id
– Rakesh Jesadiya
Dec 29 '16 at 11:37
Try to dump out the order data
var_dump($order->getData())
– Khoa TruongDinh
Dec 29 '16 at 10:44
Try to dump out the order data
var_dump($order->getData())
– Khoa TruongDinh
Dec 29 '16 at 10:44
No, it is not working .
– Jancy Abraham
Dec 29 '16 at 10:50
No, it is not working .
– Jancy Abraham
Dec 29 '16 at 10:50
Try to die
var_dump($order->getData()); die();
.– Khoa TruongDinh
Dec 29 '16 at 11:00
Try to die
var_dump($order->getData()); die();
.– Khoa TruongDinh
Dec 29 '16 at 11:00
Try with $order->getEntityId();
– Rakesh Jesadiya
Dec 29 '16 at 11:17
Try with $order->getEntityId();
– Rakesh Jesadiya
Dec 29 '16 at 11:17
2
2
you can use sales_order_save_after event to get order id
– Rakesh Jesadiya
Dec 29 '16 at 11:37
you can use sales_order_save_after event to get order id
– Rakesh Jesadiya
Dec 29 '16 at 11:37
|
show 1 more comment
3 Answers
3
active
oldest
votes
In Magento 2 observer I used this code, you get the order data like this,
use MagentoFrameworkEventObserverInterface;
class YOUROBSERVERCLASS implements ObserverInterface
protected $orderFactory;
public function __construct(MagentoQuoteModelQuoteFactory $quoteFactory,
MagentoSalesModelOrder $orderFactory)
$this->orderFactory = $orderFactory;
public function execute(MagentoFrameworkEventObserver $observer)
$orderIds = $observer->getEvent()->getOrderIds();
$lastorderId = $orderIds[0];
$order = $this->orderFactory->load($lastorderId);
add a comment |
This is an old question but given I have just faced the same problem myself I thought I would give my take on the answer. sales_order_place_after
is triggered before the order is saved to db so at the point your code is running the order entity ID doesn't exist. There are few options to work around this:
You could use sales_order_save_after
which is triggered after the order is actually persisted to db. This will allow you to have access to the order ID. This approach has risks however as it can be triggered again after the order is created. If you only want to run your code only once when the order is first placed, using this observer may have unexpected side effects.
Alternatively rather than using an observer you could create a plugin around MagentoSalesApiOrderManagementInterface::place
. This will allow you to do what I suspect you are trying to do with sales_order_place_after
.
As a rough example your modules etc/di.xml
would look something like this:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="my-module-order-service" type="MyModulePluginOrderServicePlugin" sortOrder="5"/>
</type>
</config>
And your plugin class like this:
<?php
namespace MyModulePlugin;
class OrderServicePlugin
public function aroundPlace(MagentoSalesModelServiceOrderService $subject, Closure $proceed, MagentoSalesApiDataOrderInterface $order)
$return = $proceed($order);
$orderId = $order->getEntityId();
// your custom code
return $return;
add a comment |
It is better to avoid around plugin unless necessary . Use after plugin or MagentoSalesApiOrderManagementInterface::place
etc/di.xml
<?xml version="1.0" ?>
<config>
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="MyOrderPlaceAfterPlugin" type="MyModulePluginOrderPlaceAfterPlugin" sortOrder="99" />
</type>
</config>
MyModulePluginOrderPlaceAfterPlugin.php
//namespace MyModulePluginOrder;
class PlaceAfterPlugin
/**
* @param MagentoSalesApiOrderManagementInterface $orderManagementInterface
* @param MagentoSalesModelOrderInterceptor $order
* @return $order
*/
public function afterPlace(MagentoSalesApiOrderManagementInterface $orderManagementInterface , $order)
$orderId = $order->getId();
// do something with order object (Interceptor )
return $order;
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f152350%2fmagento-2-sales-order-place-after-not-returning-order-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In Magento 2 observer I used this code, you get the order data like this,
use MagentoFrameworkEventObserverInterface;
class YOUROBSERVERCLASS implements ObserverInterface
protected $orderFactory;
public function __construct(MagentoQuoteModelQuoteFactory $quoteFactory,
MagentoSalesModelOrder $orderFactory)
$this->orderFactory = $orderFactory;
public function execute(MagentoFrameworkEventObserver $observer)
$orderIds = $observer->getEvent()->getOrderIds();
$lastorderId = $orderIds[0];
$order = $this->orderFactory->load($lastorderId);
add a comment |
In Magento 2 observer I used this code, you get the order data like this,
use MagentoFrameworkEventObserverInterface;
class YOUROBSERVERCLASS implements ObserverInterface
protected $orderFactory;
public function __construct(MagentoQuoteModelQuoteFactory $quoteFactory,
MagentoSalesModelOrder $orderFactory)
$this->orderFactory = $orderFactory;
public function execute(MagentoFrameworkEventObserver $observer)
$orderIds = $observer->getEvent()->getOrderIds();
$lastorderId = $orderIds[0];
$order = $this->orderFactory->load($lastorderId);
add a comment |
In Magento 2 observer I used this code, you get the order data like this,
use MagentoFrameworkEventObserverInterface;
class YOUROBSERVERCLASS implements ObserverInterface
protected $orderFactory;
public function __construct(MagentoQuoteModelQuoteFactory $quoteFactory,
MagentoSalesModelOrder $orderFactory)
$this->orderFactory = $orderFactory;
public function execute(MagentoFrameworkEventObserver $observer)
$orderIds = $observer->getEvent()->getOrderIds();
$lastorderId = $orderIds[0];
$order = $this->orderFactory->load($lastorderId);
In Magento 2 observer I used this code, you get the order data like this,
use MagentoFrameworkEventObserverInterface;
class YOUROBSERVERCLASS implements ObserverInterface
protected $orderFactory;
public function __construct(MagentoQuoteModelQuoteFactory $quoteFactory,
MagentoSalesModelOrder $orderFactory)
$this->orderFactory = $orderFactory;
public function execute(MagentoFrameworkEventObserver $observer)
$orderIds = $observer->getEvent()->getOrderIds();
$lastorderId = $orderIds[0];
$order = $this->orderFactory->load($lastorderId);
edited Dec 1 '17 at 9:55
amorcian
33
33
answered Dec 29 '16 at 12:46
Dhiren VasoyaDhiren Vasoya
4,38551844
4,38551844
add a comment |
add a comment |
This is an old question but given I have just faced the same problem myself I thought I would give my take on the answer. sales_order_place_after
is triggered before the order is saved to db so at the point your code is running the order entity ID doesn't exist. There are few options to work around this:
You could use sales_order_save_after
which is triggered after the order is actually persisted to db. This will allow you to have access to the order ID. This approach has risks however as it can be triggered again after the order is created. If you only want to run your code only once when the order is first placed, using this observer may have unexpected side effects.
Alternatively rather than using an observer you could create a plugin around MagentoSalesApiOrderManagementInterface::place
. This will allow you to do what I suspect you are trying to do with sales_order_place_after
.
As a rough example your modules etc/di.xml
would look something like this:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="my-module-order-service" type="MyModulePluginOrderServicePlugin" sortOrder="5"/>
</type>
</config>
And your plugin class like this:
<?php
namespace MyModulePlugin;
class OrderServicePlugin
public function aroundPlace(MagentoSalesModelServiceOrderService $subject, Closure $proceed, MagentoSalesApiDataOrderInterface $order)
$return = $proceed($order);
$orderId = $order->getEntityId();
// your custom code
return $return;
add a comment |
This is an old question but given I have just faced the same problem myself I thought I would give my take on the answer. sales_order_place_after
is triggered before the order is saved to db so at the point your code is running the order entity ID doesn't exist. There are few options to work around this:
You could use sales_order_save_after
which is triggered after the order is actually persisted to db. This will allow you to have access to the order ID. This approach has risks however as it can be triggered again after the order is created. If you only want to run your code only once when the order is first placed, using this observer may have unexpected side effects.
Alternatively rather than using an observer you could create a plugin around MagentoSalesApiOrderManagementInterface::place
. This will allow you to do what I suspect you are trying to do with sales_order_place_after
.
As a rough example your modules etc/di.xml
would look something like this:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="my-module-order-service" type="MyModulePluginOrderServicePlugin" sortOrder="5"/>
</type>
</config>
And your plugin class like this:
<?php
namespace MyModulePlugin;
class OrderServicePlugin
public function aroundPlace(MagentoSalesModelServiceOrderService $subject, Closure $proceed, MagentoSalesApiDataOrderInterface $order)
$return = $proceed($order);
$orderId = $order->getEntityId();
// your custom code
return $return;
add a comment |
This is an old question but given I have just faced the same problem myself I thought I would give my take on the answer. sales_order_place_after
is triggered before the order is saved to db so at the point your code is running the order entity ID doesn't exist. There are few options to work around this:
You could use sales_order_save_after
which is triggered after the order is actually persisted to db. This will allow you to have access to the order ID. This approach has risks however as it can be triggered again after the order is created. If you only want to run your code only once when the order is first placed, using this observer may have unexpected side effects.
Alternatively rather than using an observer you could create a plugin around MagentoSalesApiOrderManagementInterface::place
. This will allow you to do what I suspect you are trying to do with sales_order_place_after
.
As a rough example your modules etc/di.xml
would look something like this:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="my-module-order-service" type="MyModulePluginOrderServicePlugin" sortOrder="5"/>
</type>
</config>
And your plugin class like this:
<?php
namespace MyModulePlugin;
class OrderServicePlugin
public function aroundPlace(MagentoSalesModelServiceOrderService $subject, Closure $proceed, MagentoSalesApiDataOrderInterface $order)
$return = $proceed($order);
$orderId = $order->getEntityId();
// your custom code
return $return;
This is an old question but given I have just faced the same problem myself I thought I would give my take on the answer. sales_order_place_after
is triggered before the order is saved to db so at the point your code is running the order entity ID doesn't exist. There are few options to work around this:
You could use sales_order_save_after
which is triggered after the order is actually persisted to db. This will allow you to have access to the order ID. This approach has risks however as it can be triggered again after the order is created. If you only want to run your code only once when the order is first placed, using this observer may have unexpected side effects.
Alternatively rather than using an observer you could create a plugin around MagentoSalesApiOrderManagementInterface::place
. This will allow you to do what I suspect you are trying to do with sales_order_place_after
.
As a rough example your modules etc/di.xml
would look something like this:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="my-module-order-service" type="MyModulePluginOrderServicePlugin" sortOrder="5"/>
</type>
</config>
And your plugin class like this:
<?php
namespace MyModulePlugin;
class OrderServicePlugin
public function aroundPlace(MagentoSalesModelServiceOrderService $subject, Closure $proceed, MagentoSalesApiDataOrderInterface $order)
$return = $proceed($order);
$orderId = $order->getEntityId();
// your custom code
return $return;
edited 39 secs ago
answered May 15 '18 at 2:50
Andrew KettAndrew Kett
2,68911226
2,68911226
add a comment |
add a comment |
It is better to avoid around plugin unless necessary . Use after plugin or MagentoSalesApiOrderManagementInterface::place
etc/di.xml
<?xml version="1.0" ?>
<config>
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="MyOrderPlaceAfterPlugin" type="MyModulePluginOrderPlaceAfterPlugin" sortOrder="99" />
</type>
</config>
MyModulePluginOrderPlaceAfterPlugin.php
//namespace MyModulePluginOrder;
class PlaceAfterPlugin
/**
* @param MagentoSalesApiOrderManagementInterface $orderManagementInterface
* @param MagentoSalesModelOrderInterceptor $order
* @return $order
*/
public function afterPlace(MagentoSalesApiOrderManagementInterface $orderManagementInterface , $order)
$orderId = $order->getId();
// do something with order object (Interceptor )
return $order;
add a comment |
It is better to avoid around plugin unless necessary . Use after plugin or MagentoSalesApiOrderManagementInterface::place
etc/di.xml
<?xml version="1.0" ?>
<config>
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="MyOrderPlaceAfterPlugin" type="MyModulePluginOrderPlaceAfterPlugin" sortOrder="99" />
</type>
</config>
MyModulePluginOrderPlaceAfterPlugin.php
//namespace MyModulePluginOrder;
class PlaceAfterPlugin
/**
* @param MagentoSalesApiOrderManagementInterface $orderManagementInterface
* @param MagentoSalesModelOrderInterceptor $order
* @return $order
*/
public function afterPlace(MagentoSalesApiOrderManagementInterface $orderManagementInterface , $order)
$orderId = $order->getId();
// do something with order object (Interceptor )
return $order;
add a comment |
It is better to avoid around plugin unless necessary . Use after plugin or MagentoSalesApiOrderManagementInterface::place
etc/di.xml
<?xml version="1.0" ?>
<config>
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="MyOrderPlaceAfterPlugin" type="MyModulePluginOrderPlaceAfterPlugin" sortOrder="99" />
</type>
</config>
MyModulePluginOrderPlaceAfterPlugin.php
//namespace MyModulePluginOrder;
class PlaceAfterPlugin
/**
* @param MagentoSalesApiOrderManagementInterface $orderManagementInterface
* @param MagentoSalesModelOrderInterceptor $order
* @return $order
*/
public function afterPlace(MagentoSalesApiOrderManagementInterface $orderManagementInterface , $order)
$orderId = $order->getId();
// do something with order object (Interceptor )
return $order;
It is better to avoid around plugin unless necessary . Use after plugin or MagentoSalesApiOrderManagementInterface::place
etc/di.xml
<?xml version="1.0" ?>
<config>
<type name="MagentoSalesApiOrderManagementInterface">
<plugin name="MyOrderPlaceAfterPlugin" type="MyModulePluginOrderPlaceAfterPlugin" sortOrder="99" />
</type>
</config>
MyModulePluginOrderPlaceAfterPlugin.php
//namespace MyModulePluginOrder;
class PlaceAfterPlugin
/**
* @param MagentoSalesApiOrderManagementInterface $orderManagementInterface
* @param MagentoSalesModelOrderInterceptor $order
* @return $order
*/
public function afterPlace(MagentoSalesApiOrderManagementInterface $orderManagementInterface , $order)
$orderId = $order->getId();
// do something with order object (Interceptor )
return $order;
answered Sep 25 '18 at 17:05
Aunik RahmanAunik Rahman
12
12
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f152350%2fmagento-2-sales-order-place-after-not-returning-order-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try to dump out the order data
var_dump($order->getData())
– Khoa TruongDinh
Dec 29 '16 at 10:44
No, it is not working .
– Jancy Abraham
Dec 29 '16 at 10:50
Try to die
var_dump($order->getData()); die();
.– Khoa TruongDinh
Dec 29 '16 at 11:00
Try with $order->getEntityId();
– Rakesh Jesadiya
Dec 29 '16 at 11:17
2
you can use sales_order_save_after event to get order id
– Rakesh Jesadiya
Dec 29 '16 at 11:37