add orderNumber

This commit is contained in:
Kai Ton 2024-05-20 14:28:07 +07:00
parent 498471d50b
commit a700aa0fd0
1 changed files with 2 additions and 0 deletions

View File

@ -5,6 +5,7 @@ namespace IpSupply\SyncOrder\Sync;
class Order implements \JsonSerializable class Order implements \JsonSerializable
{ {
public $orderId = 0; public $orderId = 0;
public $orderNumber = '';
public $statusPayment = null; public $statusPayment = null;
public $orderDate = null; public $orderDate = null;
public $subTotal = null; public $subTotal = null;
@ -15,6 +16,7 @@ class Order implements \JsonSerializable
function __construct(\Magento\Sales\Model\Order $order) function __construct(\Magento\Sales\Model\Order $order)
{ {
$this->orderId = $order->getId(); $this->orderId = $order->getId();
$this->orderNumber = $order->getRealOrderId();
$this->statusPayment = $order->getStatus(); $this->statusPayment = $order->getStatus();
$this->orderDate = $order->getUpdatedAt(); $this->orderDate = $order->getUpdatedAt();
$this->subTotal = $order->getSubtotal(); $this->subTotal = $order->getSubtotal();