@if($product->image) {{ $product->name }} @else
@endif
@if($product->Amount === 0) Sold Out @elseif($product->Amount <= 5) {{ $product->Amount }} Left @else Available @endif
@php // Sales count - only count completed orders that contain this product $salesCount = \App\Models\Order::where('cart_data', 'LIKE', '%"product_id":' . $product->id . '%') ->where('status', 'completed') ->count(); @endphp 0

Total Sales

People have purchased this item

{{ $product->name }}

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

Premium Quality Product

@if($product->Amount === 0)
Out of Stock
@elseif($product->Amount <= 5)
Only {{ $product->Amount }} left

Hurry! Limited stock

@else
In Stock

{{ $product->Amount }} available

@endif

Product Description

{{ $product->description }}

@if($product->Amount > 0)

Add to Cart

@csrf
Quantity:
1
Total Price:
฿{{ number_format($product->price, 2) }}
@else

Out of Stock

This product is currently unavailable. Please check back later.

@endif