@extends('ecommerce::layout.store-layout') @php $localized = static function ($value, $fallback = '') { if (is_array($value)) return $value[app()->getLocale()] ?? $value['en'] ?? reset($value) ?? $fallback; return $value ?: $fallback; }; $logo = static fn($merchant) => $merchant->logo ?: asset('assets/ecommerce/images/logo.png'); @endphp @section('title', __('ecommerce::ecommerce.merchants_list')) @section('active-nav', 'merchants') @section('page-styles') @endsection @section('content')
@forelse($merchants as $merchant)@php $name = $localized($merchant->company_name, $merchant->name); $description = $localized($merchant->description, __('ecommerce::ecommerce.default_merchant_desc')); $rating = (float) ($merchant->rate ?? 0); $branches = $merchant->branches_count ?? $merchant->branches()->count(); $items = $merchant->items_count ?? $merchant->items()->count();@endphp
★ {{ number_format($rating, 1) }}

{{ $name }} @if($merchant->is_verified)@endif

{{ Str::limit($description, 55) }}

{{ $branches }}@lang('ecommerce::ecommerce.branches')
{{ $items }}@lang('ecommerce::ecommerce.sales')
@if($merchant->phone)
{{ $merchant->phone }}
@endif @if($merchant->email)
{{ $merchant->email }}
@endif
@empty
@lang('ecommerce::ecommerce.no_matching_merchants')
@endforelse
@if($merchants->hasPages()) @endif
@endsection