management integration start
This commit is contained in:
parent
10d67ac765
commit
bd9a0aa4c9
|
|
@ -3,8 +3,7 @@
|
|||
namespace Sarga\API\Http\Resources\Checkout;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Sarga\API\Http\Resources\Catalog\Product as ProductResource;
|
||||
use Webkul\Marketplace\Repositories\ProductRepository;
|
||||
use Sarga\API\Http\Resources\Catalog\Product;
|
||||
|
||||
class CartItemResource extends JsonResource
|
||||
{
|
||||
|
|
@ -32,8 +31,8 @@ class CartItemResource extends JsonResource
|
|||
'additional' => is_array($this->resource->additional)
|
||||
? $this->resource->additional
|
||||
: json_decode($this->resource->additional, true),
|
||||
'child' => new self($this->child),
|
||||
'product' => $this->when($this->product_id, new CartItemProduct($this->product)),
|
||||
'main_product' => $this->when($this->child, new Product($this->product)),
|
||||
'product' => $this->when($this->product_id, new CartItemProduct($this->child->product ?? $this->product)),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace Sarga\API\Http\Resources\Customer;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Sarga\API\Http\Resources\Catalog\Product;
|
||||
use Sarga\API\Http\Resources\Checkout\CartItemProduct;
|
||||
|
||||
class OrderItemResource extends JsonResource
|
||||
|
|
@ -56,7 +57,7 @@ class OrderItemResource extends JsonResource
|
|||
// 'additional' => is_array($this->resource->additional)
|
||||
// ? $this->resource->additional
|
||||
// : json_decode($this->resource->additional, true),
|
||||
'child' => new self($this->child),
|
||||
'main_product' => new Product($this->product),
|
||||
// 'children' => Self::collection($this->children),
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue