Extra Info Added
This commit is contained in:
parent
2e03a4dde4
commit
cd26f99153
|
|
@ -50,10 +50,23 @@ class Product extends JsonResource
|
|||
'description' => $product->description,
|
||||
'images' => ProductImage::collection($product->images),
|
||||
'base_image' => $this->productImageHelper->getProductBaseImage($product),
|
||||
'variants' => Self::collection($product->variants),
|
||||
'created_at' => $product->created_at,
|
||||
'updated_at' => $product->updated_at,
|
||||
|
||||
/* child informations */
|
||||
'grouped_products' => $this->when(
|
||||
$productTypeInstance instanceof \Webkul\Product\Type\Grouped,
|
||||
$product->grouped_products
|
||||
),
|
||||
'bundle_options' => $this->when(
|
||||
$productTypeInstance instanceof \Webkul\Product\Type\Bundle,
|
||||
$product->bundle_options
|
||||
),
|
||||
'variants' => $this->when(
|
||||
$productTypeInstance instanceof \Webkul\Product\Type\Configurable,
|
||||
$product->variants
|
||||
),
|
||||
|
||||
/* super attributes */
|
||||
$this->mergeWhen($productTypeInstance->isComposite(), [
|
||||
'super_attributes' => Attribute::collection($product->super_attributes),
|
||||
|
|
|
|||
Loading…
Reference in New Issue