@extends('ecommerce::layout.store-layout') @php $title = static fn($value) => is_array($value) ? ($value[app()->getLocale()] ?? $value['en'] ?? reset($value)) : ($value ?: ''); $image = static fn($value) => $value ?: asset('assets/images/pro/1.jpg'); $localizedName = is_array($merchant->company_name ?? null) ? ($merchant->company_name[app()->getLocale()] ?? $merchant->company_name['en'] ?? reset($merchant->company_name)) : ($merchant->company_name ?? $merchant->name); $localizedDesc = is_array($merchant->description ?? null) ? ($merchant->description[app()->getLocale()] ?? $merchant->description['en'] ?? reset($merchant->description)) : ($merchant->description ?? ''); $merchantLogo = $merchant->logo ?: asset('assets/ecommerce/images/logo.png'); $merchantRating = (float) ($merchant->rate ?? $merchant->rating ?? 0); $totalProducts = $products instanceof \Illuminate\Pagination\LengthAwarePaginator ? $products->total() : $products->count(); // Split the store's own uploads the way visitors expect to see them. $attachmentImages = ($attachments ?? collect())->filter->is_image->values(); $attachmentDocs = ($attachments ?? collect())->reject->is_image->values(); $fileSize = static function ($bytes) { $kb = round(((float) $bytes) / 1024, 0); return $kb >= 1024 ? __('ecommerce::ecommerce.file_size_mb', ['size' => number_format($kb / 1024, 1)]) : __('ecommerce::ecommerce.file_size_kb', ['size' => number_format($kb)]); }; @endphp @section('title', $localizedName) @section('active-nav', 'merchants') @section('page-styles') @endsection @section('content')

{{ $localizedName }}

@if($merchant->is_verified) @lang('ecommerce::ecommerce.verified') @endif {{ number_format($merchantRating, 1) }} @lang('ecommerce::ecommerce.rating') {{ $totalProducts }} @lang('ecommerce::ecommerce.sales') @if($merchant->phone) {{ $merchant->phone }} @endif @if($merchant->email) {{ $merchant->email }} @endif
@if($localizedDesc)

{{ $localizedDesc }}

@endif
@lang('ecommerce::ecommerce.showing_products_count', ['count' => $products->count(), 'total' => $totalProducts])
@forelse($products as $product) @empty
@lang('ecommerce::ecommerce.products.no_products_found')
@endforelse
@if($products->hasPages()) @endif
{{-- Store attachments: read-only list of files the merchant uploaded. HIDDEN (commented out) - section class="attachments"

@lang('ecommerce::ecommerce.store_attachments')

@lang('ecommerce::ecommerce.store_attachments_desc')

@if($attachments->isEmpty())
@lang('ecommerce::ecommerce.store_no_attachments')
@else @if($attachmentImages->isNotEmpty())

@lang('ecommerce::ecommerce.store_attachment_images')

@foreach($attachmentImages as $file) {{ $file->display_name }} {{ $file->display_name }} @endforeach
@endif @if($attachmentDocs->isNotEmpty())

@lang('ecommerce::ecommerce.store_attachment_files')

@endif @endif
--}}
@endsection @section('scripts') @endsection