@extends('layouts.admin') @section('title', 'Products') @section('content')

Products

+ Add Product
@foreach($products as $product) @php // Convert price to selected currency $rate = $currencies[$selectedCurrency]['rate'] ?? 1; $convertedPrice = $product->price * $rate; $convertedSalePrice = $product->sale_price ? $product->sale_price * $rate : null; $symbol = $currencies[$selectedCurrency]['symbol'] ?? 'Rp'; @endphp @endforeach @if($products->isEmpty()) @endif
ID Image Name Game Price ({{ $selectedCurrency }}) Stock Status Actions
{{ $product->id }} @if($product->image) {{ $product->name }} @else
No image
@endif
{{ $product->name }} {{ $product->game->name ?? 'N/A' }} @if($convertedSalePrice) {{ $symbol }} {{ number_format($convertedPrice, $selectedCurrency == 'IDR' ? 0 : 2) }} {{ $symbol }} {{ number_format($convertedSalePrice, $selectedCurrency == 'IDR' ? 0 : 2) }} @else {{ $symbol }} {{ number_format($convertedPrice, $selectedCurrency == 'IDR' ? 0 : 2) }} @endif @if($product->stock > 0) {{ $product->stock }} @else Out of stock @endif {{ $product->status }} Edit
@csrf @method('DELETE')
No products found. Click "Add Product" to create one.
{{ $products->links() }}
@endsection