📜  加载 order by entity_id magento 2 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:05.025000             🧑  作者: Mango

代码示例1
protected $orderRepository;

public function __construct(
    \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
){
    $this->orderRepository = $orderRepository;
}
$order = $this->orderRepository->get($orderId);
$orderIncrementId = $order->getIncrementId(); // To get order incremental id