@php $imagePath = \App\Helpers\ImageHelper::getProductImage($product); $isInWishlist = auth()->check() && auth()->user()->wishlists()->where('product_id', $product->id)->exists(); $isOnSale = $product->isOnSale(); $discountPercentage = $product->getDiscountPercentage(); @endphp @push('styles') @endpush
@if($isOnSale)
{{ $discountPercentage }}% OFF
@endif {{ $product->name }} @auth
@csrf
@endauth
{{ $product->name }}
@if($isOnSale) ${{ number_format($product->price, 2) }} ${{ number_format($product->sale_price, 2) }} @else ${{ number_format($product->price, 2) }} @endif