expose downloadable links in API Resource\Sales\Order.php and src\Models\OrderItem.php

This commit is contained in:
Herbert Maschke 2020-06-24 20:53:01 +02:00
parent 4d85fc4463
commit f30da1f3a4
2 changed files with 4 additions and 1 deletions

View File

@ -100,10 +100,11 @@ class Order extends JsonResource
'channel' => $this->when($this->channel_id, new ChannelResource($this->channel)),
'shipping_address' => new OrderAddress($this->shipping_address),
'billing_address' => new OrderAddress($this->billing_address),
'updated_at' => $this->updated_at,
'items' => OrderItem::collection($this->items),
'invoices' => Invoice::collection($this->invoices),
'shipments' => Shipment::collection($this->shipments),
'downloadable_links' => $this->downloadable_link_purchased,
'updated_at' => $this->updated_at,
'created_at' => $this->created_at,
];
}

View File

@ -213,6 +213,8 @@ class OrderItem extends Model implements OrderItemContract
$array['qty_to_refund'] = $this->qty_to_refund;
$array['downloadable_links'] = $this->downloadable_link_purchased;
return $array;
}
}