diff --git a/resources/views/front/sable/home.blade.php b/resources/views/front/sable/home.blade.php index d975c3f9..944bdd9e 100644 --- a/resources/views/front/sable/home.blade.php +++ b/resources/views/front/sable/home.blade.php @@ -44,9 +44,12 @@ @endif
foodProduct->nutriscore . ".png") }}"> - @can('addToCart', $product) + @if( + Auth::guard('customer')->user() && + Auth::guard('customer')->user()->can('addToCart', $product) + ) - @endcan + @endif
diff --git a/resources/views/front/sable/product.blade.php b/resources/views/front/sable/product.blade.php index 89b87c37..1f583045 100644 --- a/resources/views/front/sable/product.blade.php +++ b/resources/views/front/sable/product.blade.php @@ -53,9 +53,12 @@ /{{ $product->sell_unit }}

- @can('addToCart', $product) + @if( + Auth::guard('customer')->user() && + Auth::guard('customer')->user()->can('addToCart', $product) + ) - @endcan + @endif @if ($product->weight_variable)

*Produit vendu au kilo : @fmt_currency($product->priceKgTtc)/kg