daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Nov 23rd, 2017 41 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $objectManager = MagentoFrameworkAppObjectManager::getInstance();
  2. $order = $objectManager->create('MagentoSalesModelOrder')->loadByIncrementId($IncrementId); //Use increment id here.
  3. $order->getCustomerName();
  4.    
  5. protected $orderRepository;
  6.  
  7.     public function __construct(
  8.         ...
  9.         MagentoSalesApiOrderRepositoryInterface $orderRepository,
  10.         ...
  11.     ) {
  12.         ...
  13.         $this->orderRepository = $orderRepository;
  14.         ...
  15.     }
  16.  
  17.     public function getOrderStatus($orderId)
  18.     {
  19.         $order = $this->orderRepository->get($orderId);
  20.         $state = $order->getState(); //Get Order State(Complete, Processing, ....)
  21.         return $state;
  22.     }
  23.    
  24. $orderId = 1; //Order Id
  25. echo $block->getOrderStatus($orderId);
RAW Paste Data
Top