@extends('layouts.app') @section('title', $product->name) @section('content')
@if($product->image_url) {{ $product->name }} @else
📦
@endif
@if($product->is_featured) Featured @endif @if($product->compare_price && $product->compare_price > $product->price) @php $discount = round((($product->compare_price - $product->price) / $product->compare_price) * 100); @endphp -{{ $discount }}% @endif
@if($product->supplier) {{ $product->supplier->company_name }} @endif

{{ $product->name }}

@for($i = 1; $i <= 5; $i++) @if($i <= $product->rating) ★ @else ★ @endif @endfor
({{ $product->rating }}/5)
R {{ number_format($product->price, 2) }} @if($product->compare_price && $product->compare_price > $product->price) R {{ number_format($product->compare_price, 2) }} @endif

Price per {{ $product->unit }}

VAT included

@if($product->stock_quantity > 10) In Stock ({{ $product->stock_quantity }} available) @elseif($product->stock_quantity > 0) Low Stock ({{ $product->stock_quantity }} left) @else Out of Stock @endif
@auth @if(auth()->user()->user_type === 'company' && $product->stock_quantity > 0)
@csrf
Min: {{ $product->min_order_quantity }}
@elseif($product->stock_quantity <= 0) @endif @else Login to Purchase @endauth

Product Details

SKU
{{ $product->sku }}
Category
{{ $product->category?->name ?? 'Uncategorized' }}
Unit
{{ $product->unit }}
Min Order
{{ $product->min_order_quantity }} {{ $product->unit }}

Description

{!! nl2br(e($product->description)) !!}
@if($priceComparison->count() > 0)

Compare Prices from Other Suppliers

@foreach($priceComparison as $item) @endforeach
Product Supplier Price Action
{{ $item->name }} {{ $item->supplier?->company_name }} R {{ number_format($item->price, 2) }} View
@endif @if($similarProducts->count() > 0)

Similar Products

@foreach($similarProducts as $similar) @include('components.product-card', ['product' => $similar]) @endforeach
@endif
@endsection