I'm new to Magento and the next step I want to learn is to listen to an event. So, I'm trying to find which event should I trigger that works after a customer has placed an order that also carries that order's information, including product SKUs, Order number, etc.?

3 Answers 3


Events in Magento 2 are dispatched based on an action performed and it passes data to the observer. Observers are Magento classes that are executed when an event is dispatched. Here, we will make use of this concept to get order data from Magento 2

“sales_order_place_after” event.

Step 1: Create events.xml file at app/code/Vendor/Extension/etc/

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <event name="sales_order_place_after">
        <observer name="place_order_after" instance="Vendor\Extension\Observer\Orderplaceafter"/>

Step 2: Create Orderplaceafter.php at app/code/Vendor/Extension/Observer/

namespace Vendor\Extension\Observer;
use Magento\Framework\Event\ObserverInterface;
use Psr\Log\LoggerInterface;
class Orderplaceafter implements ObserverInterface
    protected $logger;
    public function __construct(LoggerInterface $logger)
        $this->logger = $logger;
    public function execute(\Magento\Framework\Event\Observer $observer)
        try {
            $order = $observer->getEvent()->getOrder();
        } catch (\Exception $e) {

I'm using Magento 2.3.x and 2.4.x and I use this event: sales_order_save_commit_after


I get most informations I need from a order by using checkout_onepage_controller_success_action You get the orderid, customer informations and the item informations.

Just as an addition: I tried multiple observers - most of them have one or two problems: Either, the informations are not in the database, when the trigger gets triggered or it gets triggered each time, an order is saved (so it gets triggered multiple times, even after the checkout process is done already).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.