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 diff --git a/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php b/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php index f019d40ce..f6fb83eca 100755 --- a/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php +++ b/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php @@ -72,9 +72,10 @@ class SubscriptionController extends Controller $customer = $subscriber->customer; - $customer->subscribed_to_news_letter = $data['is_subscribed']; - - $customer->save(); + if (! is_null($customer)) { + $customer->subscribed_to_news_letter = $data['is_subscribed']; + $customer->save(); + } $result = $subscriber->update($data); diff --git a/resources/themes/.gitignore b/resources/themes/.gitignore deleted file mode 100755 index d6b7ef32c..000000000 --- a/resources/themes/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore