Is their any way i can get the product names in sales_order_place_after observer ?

I get the order object but not sure how to fetch the products.

Any thoughts ?

3 Answers 3


You can get product names from order object like as follows:

$order = $observer->getEvent()->getOrder();

foreach ($order->getAllItems() as $item) {
    $arrProductNames[] = $item->getName();

You can retrieve the product names like this:

/** @var \Magento\Sales\Model\Order $order */
$order = $observer->getOrder();

foreach ($order->getItems() as $item) {
    // retrieve the names from the order items
    $productNames[] = $item->getName();

    // or retrieve the names from the product instance
    $productNames2[] = $item->getProduct()->getName();

In order to obtain the ordered product order data from the sales_order_after observer in the order that you would like, parse the orders in an orderly manner:

$fantasticOrderData = $observer->getEvent()->getOrder();

foreach ($fantasticOrderData->getAllItems() as $evenMoreFantasticItemData) {
    $superDuperCoolProductNames[] = $evenMoreFantasticItemData->getName();

I trust this answer is in order.

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.