0

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"}}
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
?>
  • Using object manager in the file directly is not a good approach. – Sumit Sep 11 at 10:21
  • That is not working for me, any solutions? – Denny Danu Sep 11 at 11:09
  • It means you have error in your collection. @DennyDanu – Oscprofessionals Sep 11 at 11:10
  • 1
    yes, we can not recommend to use object manager directly @Sumit – Oscprofessionals Sep 11 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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