Merge pull request #4660 from rahulshukla-webkul/development
Issue #4643 fixed
This commit is contained in:
commit
9176fed0fa
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Webkul\API\Http\Resources\Catalog;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class ProductVideo extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'type' => $this->type,
|
||||
'url' => $this->url
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
||||
Loading…
Reference in New Issue