Magento 2.1.0
Porto theme

I have a problem with Magento 2.1.0 - it gives the


Something went wrong." Error message."

I have not been able to fix that.

Now someone placed an order and I am not able to see it (because of the Error).

How to retrieve order info from the database?

PS: I just found out that a different (not Admin) user account is showing SALES - ORDERS while my Admin account gives the Error. What could be the reason for that?

  • open your browser console and check what is the error and update your question with error details.
    – Sohel Rana
    Commented Jun 17, 2017 at 15:42
  • @Sohel Rana This Error comes up in Admin under SALES - ORDERS...would that still show a more specific Error in the browser?
    – Allysin
    Commented Jun 17, 2017 at 15:53

1 Answer 1


Attention error, many times coming due not loading js properly.

But you can get order by using sales order model in following way:

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();

$orderData = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);

$orderInfo = (array)$orderData->getData();


If you want to see order info in db, then see this 'sales_order' table into database.

  • Thank you so much for your suggestion. Where can I put the code you included so that I can retrieve the order info? Thanks again. Also - how would I check/correct the js loading thing?
    – Allysin
    Commented Jun 17, 2017 at 15:52
  • I am in the database and I found the "mydatabasename_sales_order" table. When I click it - it shows the list of orders (there are 5) - how would I actually display the contents of the individual orders? Is there some kind of a SQL query for that?
    – Allysin
    Commented Jun 17, 2017 at 16:11
  • Hi Allysin, Please get the code for getting order info by going into given below link brijeshtech.in/magento2-get-order-info-by-order-id Please put the code into the root location of magento. You can see the js error into browser error console.
    – Brijesh
    Commented Jun 17, 2017 at 18:47
  • I created a file called orders.php and placed the code in it. When I access www.mysite.com/orders.php - it gives the following Error: Notice: Use of undefined constant ORDER_ENTITY_ID - assumed 'ORDER_ENTITY_ID' in /home/mySITE/public_html/orders.php on line 10 If I try to enter the order number instead of ORDER_ENTITY_ID or $orderId = it does not load. What am I doing wrong? Thank you
    – Allysin
    Commented Jun 17, 2017 at 19:54
  • ORDER_ENTITY_ID means the entity id of order.
    – Brijesh
    Commented Jun 17, 2017 at 19:58

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.