diff --git a/packages/Webkul/API/Http/Resources/Catalog/Product.php b/packages/Webkul/API/Http/Resources/Catalog/Product.php index ef7e1ed74..649e2c36f 100644 --- a/packages/Webkul/API/Http/Resources/Catalog/Product.php +++ b/packages/Webkul/API/Http/Resources/Catalog/Product.php @@ -17,6 +17,8 @@ class Product extends JsonResource $this->productReviewHelper = app('Webkul\Product\Helpers\Review'); $this->wishlistHelper = app('Webkul\Customer\Helpers\Wishlist'); + + parent::__construct($resource); } /** @@ -45,7 +47,8 @@ class Product extends JsonResource 'formated_price' => core()->currency($productTypeInstance->getMinimalPrice()), 'short_description' => $product->short_description, 'description' => $product->description, - 'images' => ProductImageFacade::collection($product->images), + 'images' => ProductImage::collection($product->images), + 'videos' => ProductVideo::collection($product->videos), 'base_image' => ProductImageFacade::getProductBaseImage($product), 'created_at' => $product->created_at, 'updated_at' => $product->updated_at, diff --git a/packages/Webkul/API/Http/Resources/Catalog/ProductVideo.php b/packages/Webkul/API/Http/Resources/Catalog/ProductVideo.php new file mode 100644 index 000000000..c45239561 --- /dev/null +++ b/packages/Webkul/API/Http/Resources/Catalog/ProductVideo.php @@ -0,0 +1,23 @@ + $this->id, + 'type' => $this->type, + 'url' => $this->url + ]; + } +} \ No newline at end of file