error message in case user redirecting to review page of deleted product
This commit is contained in:
parent
11eadd3c9c
commit
d72beab56e
|
|
@ -34,7 +34,12 @@ class ReviewController extends Controller
|
|||
public function create($slug)
|
||||
{
|
||||
if (auth()->guard('customer')->check() || core()->getConfigData('catalog.products.review.guest_review')) {
|
||||
$product = $this->productRepository->findBySlugOrFail($slug);
|
||||
$product = $this->productRepository->findBySlug($slug);
|
||||
|
||||
if ($product == null) {
|
||||
session()->flash('error', trans('customer::app.product-removed'));
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
return view($this->_config['view'], compact('product'));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue