magento2-docker/app/code/IpSupply/SyncOrder/Sync/Order.php

31 lines
823 B
PHP
Executable File

<?php
namespace IpSupply\SyncOrder\Sync;
class Order implements \JsonSerializable
{
public $orderId = 0;
public $statusPayment = null;
public $orderDate = null;
public $subTotal = null;
public $total = null;
public $shippingPrice = null;
public $currency = null;
function __construct(\Magento\Sales\Model\Order $order)
{
$this->orderId = $order->getId();
$this->statusPayment = $order->getStatus();
$this->orderDate = $order->getUpdatedAt();
$this->subTotal = $order->getSubtotal();
$this->total = $order->getGrandTotal();
$this->shippingPrice = $order->getShippingAmount();
$this->currency = $order->getOrderCurrencyCode();
}
public function jsonSerialize(): mixed
{
return get_object_vars($this);
}
}