@extends('layouts.admin') @section('page-title','Bulk Upload — Preview') @section('content')
CSV Parsed — {{ $count }} product(s) ready to import
Review the table below, then confirm to add them to your catalogue.
@foreach($rows as $i => $row) @php $price = (float)($row['price'] ?? 0); $cost = (float)($row['cost_price'] ?? 0); $margin = $price > 0 ? round(($price - $cost) / $price * 100) : 0; $marginColor = $margin >= 50 ? 'var(--green)' : ($margin >= 25 ? 'var(--amber)' : 'var(--red)'); @endphp @endforeach
# Name Category Sale Price Cost Price Margin Stock Badge Description
{{ $i+1 }} {{ $row['name'] ?? '—' }} {{ ucfirst($row['category'] ?? 'electronics') }} ${{ number_format($price,2) }} ${{ number_format($cost,2) }} {{ $margin }}% {{ $row['stock'] ?? 0 }} {{ $row['badge'] ?? '—' }} {{ Str::limit($row['description'] ?? '', 60) }}
{{-- CONFIRM FORM --}}
@csrf
← Re-upload CSV Existing products with the same name will be skipped.
@endsection