{{-- TradeIndia-style Product Card --}} @php $seller = $product->seller; $plan = $seller->plan; $hasSubscription = $seller->hasActiveSubscription(); $showContact = $hasSubscription && ($plan?->show_contact_details ?? false); // Calculate years in business $establishedYear = $seller->created_at?->year ?? now()->year; $yearsInBusiness = now()->year - $establishedYear; if ($yearsInBusiness < 1) $yearsInBusiness = 1; // Get first image $galleryImages = $product->images_json; if (is_string($galleryImages)) { $decoded = json_decode($galleryImages, true); $galleryImages = (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) ? $decoded : [['original' => $galleryImages]]; } if (!is_array($galleryImages)) $galleryImages = []; $mainImage = !empty($galleryImages) ? asset('storage/' . ($galleryImages[0]['original'] ?? '')) : 'https://placehold.co/300x300?text=No+Image'; // Get specs from product $specs = []; if ($product->moq) $specs['MOQ'] = $product->moq . ' ' . ($product->unit->name ?? 'Pieces'); if ($product->specifications && is_array($product->specifications)) { foreach (array_slice($product->specifications, 0, 6) as $key => $value) { $specs[$key] = $value; } } @endphp
{{-- Left: Product Image --}}
India {{ $product->name }}
{{-- Middle: Product Details --}}
{{ $product->name }}
Platform MOQ Range: {{ \App\Models\Setting::getValue('min_moq', 10) }} - {{ \App\Models\Setting::getValue('max_moq', 150) }}
Product MOQ: {{ $product->moq ?? 1 }} {{ $product->unit->name ?? 'Pieces' }}
Seller handles delivery
Price: {{ $product->currency == 'USD' ? '$' : '₹' }}{{ number_format($product->price, 0) }} INR/{{ $product->unit->name ?? 'Piece' }}
Get Best Quote
@foreach($specs as $label => $value) @if($label !== 'MOQ') @endif @endforeach
{{ $label }} {{ $value }}
More details...
{{-- Right: Seller Info --}}
{{ $seller->company_name ?? 'Verified Seller' }}
{{ $seller->city ?? 'India' }}
Business Type: {{ is_array($seller->business_type) ? implode(' | ', $seller->business_type) : ($seller->business_type ?? 'Manufacturer') }}
Established In: {{ $establishedYear }}
@if($seller->is_verified || in_array($seller->kyc_status, ['submitted', 'verified']))
KYC Submitted
@else
KYC Pending
@endif @if($hasSubscription && ($plan?->is_featured ?? false))
Super Seller
@endif
{{ $yearsInBusiness }} Years
@if($showContact) @else @endif Contact Supplier Ask for a Quote
{{-- Contact Modal for this product --}} @if($showContact) @endif