{{-- resources/views/storefront/store.blade.php --}} @extends('storefront.layout') @section('title', $store->name.' - '.config('app.name', 'FreshMart')) @section('body_class', 'sf-store-page') @section('content') @php $cover = \App\Support\StorefrontPresenter::storeCover($store); $logo = \App\Support\StorefrontPresenter::storeLogo($store); $groupedProducts = $store->products->groupBy(fn ($product) => $product->category?->name ?: 'Popular items'); $categoryList = $groupedProducts->keys()->take(10); $etaLabel = data_get($store->meta, 'eta_label') ?: data_get($store->meta, 'delivery_time_label'); $radiusLabel = $store->delivery_radius_km ? number_format((float) $store->delivery_radius_km, 1).' km radius' : null; $minimumOrderLabel = $store->minimum_order_amount ? \App\Support\StorefrontPresenter::money($store->minimum_order_amount) : ($store->deliveryZone?->minimum_order_amount ? \App\Support\StorefrontPresenter::money($store->deliveryZone->minimum_order_amount) : null); $deliveryFeeLabel = data_get($store->meta, 'delivery_fee') !== null ? \App\Support\StorefrontPresenter::money((float) data_get($store->meta, 'delivery_fee')) : null; $isOpen = $store->is_open ?? true; $isFeatured = $store->is_featured ?? false; $reviewSummary = $reviewSummary ?? [ 'average' => (float) ($store->reviews_avg_rating ?? 0), 'total_ratings' => (int) ($store->reviews_count ?? 0), 'total_reviews' => (int) ($store->reviews_count ?? 0), 'distribution' => [5 => 0, 4 => 0, 3 => 0, 2 => 0, 1 => 0], 'max_count' => 0, ]; $averageRating = number_format((float) data_get($reviewSummary, 'average', $store->reviews_avg_rating ?? 0), 1); $reviewsCount = (int) data_get($reviewSummary, 'total_ratings', $store->reviews_count ?? 0); $writtenReviewsCount = (int) data_get($reviewSummary, 'total_reviews', 0); $ratingDistribution = data_get($reviewSummary, 'distribution', [5 => 0, 4 => 0, 3 => 0, 2 => 0, 1 => 0]); $maxRatingCount = max(1, (int) data_get($reviewSummary, 'max_count', 0)); $ratingFillPercent = max(0, min(100, ((float) data_get($reviewSummary, 'average', 0) / 5) * 100)); $reviewsUrl = route('storefront.stores.reviews', ['store' => $store->slug ?: $store->id] + ($storefrontQuery ?? [])); $storeService = $selectedService ?? 'grocery'; $isFoodStore = in_array($storeService, ['food', 'restaurant'], true); @endphp
{{ $store->description ?: ($isFoodStore ? 'Delicious meals from this local restaurant.' : 'Fresh items delivered from this local store.') }}
{{ $items->count() }} items available
Customer feedback for this store
{{ $review->comment }}
@endifLatest feedback for this store
{{ $review->comment }}
Details about this store