fixed active
This commit is contained in:
parent
9b6d341ba2
commit
c29cf811fc
|
|
@ -19,13 +19,6 @@ class ProductController extends Controller
|
|||
public function show(Request $request, Product $product)
|
||||
{
|
||||
$product = ProductRepo::getProductDetail($product);
|
||||
if ($product->active == 0) {
|
||||
$data = [
|
||||
'product' => (new ProductDetail($product))->jsonSerialize(),
|
||||
'error' => trans('product.has_been_inactive')
|
||||
];
|
||||
return view('product', $data);
|
||||
}
|
||||
$data = [
|
||||
'product' => (new ProductDetail($product))->jsonSerialize(),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class ProductDetail extends JsonResource
|
|||
'variables' => $this->decodeVariables($this->variables),
|
||||
'skus' => SkuDetail::collection($this->skus)->jsonSerialize(),
|
||||
'in_wishlist' => $this->inCurrentWishlist->id ?? 0,
|
||||
'active' => (bool)$this->active,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue