Magento 2: Recent Order not showing in Sales Order Grid

You place an order from frontend and expect it to be displayed in the Sales -> Orders grid in the Magento backend. But, you don’t see your recent order in the sales order grid. Cause This is because Magento uses Scheduled Grid Updates. The order related grids (order, invoice, shipment, credit memo) are updated via … Read more

Magento: Add New Column to Sales Order Grid in Admin

This article shows how you can add new columns to sales order grid in Magento 1.x admin. For this, you need to rewrite/override the Adminhtml’s sales_order_gird block class. Here is the block override code to be written in your module’s config.xml file: YourCompany/YourModule/etc/config.xml <global> <blocks> <yourmodule> <class>YourCompany_YourModule_Block</class> </yourmodule> <adminhtml> <rewrite> <sales_order_grid>YourCompany_YourModule_Block_Adminhtml_Sales_Order_Grid</sales_order_grid> </rewrite> </adminhtml> </blocks> </global> … Read more

Magento: Get Sales Quote & Order in both Frontend and Admin

Here is a code snippet to get sales quote and order data in both admin and frontend in Magento. Get Sales Quote in Frontend Mage::getSingleton('checkout/session')->getQuote(); Get Sales Quote in Admin $quote = Mage::getSingleton('adminhtml/session_quote')->getQuote(); Get Latest Order in Frontend $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId(); $order = Mage::getModel('sales/order')->loadByIncrementId($orderId); Get Latest Order in Admin $order = Mage::getModel('sales/order')->getCollection() ->setOrder('created_at','DESC') ->setPageSize(1) ->setCurPage(1) … Read more