public function __construct(stdClass $datas)
 {
     parent::__construct($datas);
     if (isset($this->datas->order)) {
         $order = $this->datas->order;
     } else {
         $order = current($this->datas->orders);
     }
     $this->datas->customer = $order->customer;
     $this->datas->customer->shippingAddress->phone = isset($order->customer->phone) ? $order->customer->phone : '000000000';
     if (isset($this->datas->customer->billingAddress)) {
         $this->datas->customer->billingAddress->phone = isset($order->customer->phone) ? $order->customer->phone : '000000000';
     }
     $this->datas->orderLineItems = $order->orderLineItems;
     if (isset($order->vouchers)) {
         $this->datas->vouchers = $order->vouchers;
     }
     if (isset($order->device)) {
         $this->datas->device = $order->device;
     }
     if (isset($this->datas->paymentResult)) {
         $this->datas->paymentResult = $this->datas->paymentResult;
     }
     if (isset($order->orderCostSummary)) {
         $this->datas->orderCostSummary = $order->orderCostSummary;
     }
     $this->checkProductsAreShippable($this->datas->orderLineItems);
     $this->initObjects();
 }
Ejemplo n.º 2
0
 public function __construct(stdClass $datas, $idCart)
 {
     parent::__construct($datas);
     $this->idCart = (int) $idCart;
     $this->cart = new Cart((int) $idCart);
 }
Ejemplo n.º 3
0
 public function __construct(stdClass $datas)
 {
     parent::__construct($datas);
     $product = PowaTagProductHelper::getProductByCode($datas->id_product, $this->context->language->id);
     $this->product = $product;
 }