diff --git a/packages/Webkul/API/Http/Resources/Catalog/Product.php b/packages/Webkul/API/Http/Resources/Catalog/Product.php index de23c8815..8141084fc 100644 --- a/packages/Webkul/API/Http/Resources/Catalog/Product.php +++ b/packages/Webkul/API/Http/Resources/Catalog/Product.php @@ -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', [