Product base image property added in prodcut api
This commit is contained in:
parent
09a0db3e46
commit
ef988b093f
|
|
@ -15,6 +15,8 @@ class Product extends JsonResource
|
|||
{
|
||||
$this->productPriceHelper = app('Webkul\Product\Helpers\Price');
|
||||
|
||||
$this->productImageHelper = app('Webkul\Product\Helpers\ProductImage');
|
||||
|
||||
parent::__construct($resource);
|
||||
}
|
||||
|
||||
|
|
@ -36,6 +38,7 @@ class Product extends JsonResource
|
|||
'description' => $this->description,
|
||||
'sku' => $this->sku,
|
||||
'images' => ProductImage::collection($product->images),
|
||||
'base_image' => $this->productImageHelper->getProductBaseImage($product),
|
||||
'variants' => Self::collection($this->variants),
|
||||
'in_stock' => $product->haveSufficientQuantity(1),
|
||||
$this->mergeWhen($product->type == 'configurable', [
|
||||
|
|
|
|||
Loading…
Reference in New Issue