@extends('layouts.frontend') @section('title', $product->name) @push('styles') @endpush @section('content')
@if($product->images->count() > 0) @else
No images available for this product.
@endif
@php $isOnSale = $product->isOnSale(); $discountPercentage = $product->getDiscountPercentage(); @endphp @if($isOnSale)
{{ $discountPercentage }}% OFF
@endif

{{ $product->name }}

@if($isOnSale)

${{ number_format($product->price, 2) }}

${{ number_format($product->sale_price, 2) }}

Save ${{ number_format($product->price - $product->sale_price, 2) }}
@else

${{ number_format($product->price, 2) }}

@endif

{{ $product->description }}

@if($product->variants->count() > 0)
@endif
@csrf
@auth
@csrf
@endauth

SKU: {{ $product->sku }}

Category: {{ $product->category->name }}

@if($relatedProducts->count() > 0) @else

No related products found. Browse more in {{ $product->category->name }}

@endif
@push('scripts') @endpush @endsection