1

When I get new order email after successful checkout, there is no information about order items. Need your help.

Email Screenshot

order_new.phtml

{{template config_path="design/email/header_template"}}

<table>
    <tr class="email-intro">
        <td>
            <p class="greeting">{{trans "%customer_name," customer_name=$order.getCustomerName()}}</p>
        </td>
    </tr>    
    <tr class="email-information">
        <td>
            {{layout handle="sales_email_order_items" order=$order area="frontend"}}
            {{var myvar8 |raw}}
        </td>
    </tr>
    <tr>
        <td>&nbsp;</td>
    </tr>
    <tr>
        <td class="method-info">
            <p>{{trans "Payment Method"}}</p>
            {{var payment_html|raw}}
        </td>
    </tr>

</table>

{{template config_path="design/email/footer_template"}}
1
  • have you found any solution. Commented Mar 18, 2020 at 18:41

4 Answers 4

6

On Magento 2.4.4 and above, go to the Email template page, find and replace:

{{layout handle="sales_email_order_items" order=$order area="frontend"}}

to

{{layout handle="sales_email_order_items" order_id=$order_id area="frontend"}}

5

I also got this issue in my magento 2.3.5-p1, based on the answer from this link :

https://community.magento.com/t5/Magento-2-x-Technical-Issues/Order-Email-not-showing-itemized-list-Magento-2-3-4/td-p/432836

just edit the column is_legacy value in the email_template table from 0 to 1, then the order items now will be displayed on the email. I've followed this way, and this is solved my problem.

2

i also got the same issue this is the final sollution I confirm, this happens also in 2.3.5-p1

The solution set in db table: email_template column is_legacy = 1

set is_legacy = 1 in desired template and it will start working like miracle Thanks

0

You can just add below code inside success.phtml file,and you can fetch required data using below code,

<?php $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
      $orderData = $objectManager->create('Magento\Sales\Model\Order')->loadByIncrementId($block->getOrderId());
      echo "<pre>";print_r($orderData->getData());   //Order_data
     //echo $orderData->getData('shipping_description'); //shipping_description
?>
5
  • Using object manager in the file directly is not a good approach.
    – Sumit
    Commented Sep 11, 2019 at 10:21
  • That is not working for me, any solutions?
    – Denny Danu
    Commented Sep 11, 2019 at 11:09
  • It means you have error in your collection. @DennyDanu Commented Sep 11, 2019 at 11:10
  • 1
    yes, we can not recommend to use object manager directly @Sumit Commented Sep 11, 2019 at 11:11
  • Have you found any solution Commented Mar 18, 2020 at 17:26

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.