Skip to content

Commit

Permalink
add transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Mar 4, 2025
1 parent 0c63b2b commit 440c585
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Http/Resources/Api/V1/Admin/Sales/OrderItemResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class OrderItemResource extends JsonResource
*/
public function toArray($request)
{

$images = [];

return [
'id' => $this->id,
'sku' => $this->sku,
Expand All @@ -30,7 +33,7 @@ public function toArray($request)
'qty_refunded' => $this->qty_refunded,
'price' => $this->price,
// get images first
'images' => $this->product->images()->first(),
'images' => $images,
'formatted_price' => core()->formatPrice($this->price, $this->order->order_currency_code),
'base_price' => $this->base_price,
'formatted_base_price' => core()->formatBasePrice($this->base_price),
Expand Down
1 change: 1 addition & 0 deletions src/Http/Resources/Api/V1/Admin/Sales/OrderResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public function toArray($request)
'invoices' => InvoiceResource::collection($this->invoices),
'shipments' => ShipmentResource::collection($this->shipments),
//'dispute' => $this->when($this->dispute, new DisputeResource($this->dispute)),
'transactions' => $this->transactions,
'dispute' => $this->dispute,
'updated_at' => $this->updated_at,
'created_at' => $this->created_at,
Expand Down

0 comments on commit 440c585

Please sign in to comment.