@extends('frontend.layouts.app') @section('meta_title'){{ $shop->meta_title }}@stop @section('meta_description'){{ $shop->meta_description }}@stop @section('meta') {{-- ===== LOGIN PROMPT POPUP ===== --}}
{{-- Header --}}
๐Ÿ”

Login Required

Please log in to continue.

{{-- Body --}}
๐Ÿš€ Login Now @if(Route::has('user.register')) โœจ Create Account @endif
@endsection @section('content') @php $subCategoryName=""; @endphp @if(isset($shop->sub_cat_ids) && !empty($shop->sub_cat_ids)) @php $subCategoryArray = explode(",", $shop->sub_cat_ids); $firstValue = $subCategoryArray[0]; $subCategory=App\Models\Category::select('name')->find($firstValue); $subCategoryName=@$subCategory->name; @endphp @endif @php $images = !empty($shop->sliders) ? explode(',', $shop->sliders) : []; $phone = optional($shop->user)->phone ?? ''; $whatsappNumber = preg_replace('/[^0-9]/', '', $phone); @endphp {{-- BREADCRUMB --}}
@if(session()->has('pincode_details')) @php $pin = session('pincode_details'); @endphp {{ $pin['city'] ?? 'Home' }} › @else Home › @endif @if(!empty($subCategoryName)) {{ $subCategoryName }} › @endif {{ $shop->name }}
{{-- GALLERY --}} @php $imgCount = count($images); $galleryClass = 'bm-gallery-4'; // default 4+ if($imgCount == 1) $galleryClass = 'bm-gallery-1'; elseif($imgCount == 2) $galleryClass = 'bm-gallery-2'; elseif($imgCount == 3) $galleryClass = 'bm-gallery-3'; @endphp
{{-- โ”€โ”€ MOBILE SLIDER (shown only on mobile via CSS) โ”€โ”€ --}} {{-- โ”€โ”€ DESKTOP GALLERY (adaptive by image count) โ”€โ”€ --}}
{{-- Main Image --}} {{-- Side Images (only for 2, 3, 4+) --}} @if($imgCount >= 2)
@foreach($images as $key => $img) @if($key > 0 && $key <= 4) @endif @endforeach
@endif
{{-- openGalleryAt is defined in the gallery lightbox JS below --}} {{-- SHOP INFO PANEL --}}
{{-- SHOP NAME CARD --}}
{{-- TOP ROW: Name + Logo --}}

{{ $shop->name }} @if($shop->verification_status == 1) @endif

{{-- Distance badge โ€” filled by JS after GPS --}} {{-- Category + Verified badges --}}
@if($shop->verification_status == 1) Verified โ€ข @endif @if(!empty($subCategoryName)) {{ $subCategoryName }} @endif
{{-- Logo --}}
{{ $shop->name }} logo {{-- placeholder only, offer moved to gallery --}}
{{-- end bm-name-card --}} @php $ratingFloat = (float)($shop->rating ?? 0); $totalRatings = $shop->totalReviews ?? 0; $reviewLink = route('guest.review.page', $shop->slug); @endphp
{{-- Left: Score + Stars + Count (click โ†’ all reviews popup) --}}
@if($ratingFloat > 0) {{ number_format($ratingFloat, 1) }}
@php $full = floor($ratingFloat); $half = ($ratingFloat - $full) >= 0.5; @endphp @for($i = 0; $i < $full; $i++) @endfor @if($half)@endif @for($i = 0; $i < 5 - $full - ($half?1:0); $i++) @endfor @if($totalRatings > 0) ({{ $totalRatings }} {{ $totalRatings == 1 ? translate('Rating') : translate('Ratings') }}) @endif
@else No Ratings Yet @endif
{{-- Right: Animated Rate + Ask Review + Share --}}
{{-- Animated Rate Stars --}} Rate This Business:
@for($r = 1; $r <= 5; $r++) @endfor
Click To Rate | {{-- Contact Seller Button --}} @if(Auth::check()) @else @endif | {{-- Chat With Seller Button --}} @if(Auth::check()) ๐Ÿ’ฌ Chat With Seller @else @endif | {{-- Share Button with Dropdown --}}
{{-- ADDRESS CARD --}}
Address
{{ $shop->address }}
{{-- ABOUT US CARD --}} @if(!empty($shop->meta_description))
โ„น๏ธ About Us

{{ Str::limit($shop->meta_description, 300) }}

@endif {{-- SPECIAL OFFER CARD --}} @if(!empty($shop->today_offer))
๐Ÿ”ฅ
Special Offer Today!
{{ $shop->today_offer }}
LIMITED
@endif {{-- ACTION BUTTONS --}}
{{-- Call --}} @if($phone) {{ $phone }} @endif {{-- Visit Store --}} Visit Store {{-- WhatsApp --}} @if($phone) WhatsApp @endif {{-- Direction --}} @php $shopLat = optional($shop->user)->latitude ?? null; $shopLng = optional($shop->user)->longitude ?? null; $directionUrl = ($shopLat && $shopLng) ? "https://www.google.com/maps/dir/?api=1&destination={$shopLat},{$shopLng}" : "https://www.google.com/maps/search/" . urlencode($shop->address ?? $shop->name); @endphp Direction Enquiry
@php if(session()->has('pincode_details')) { $pin_details = session()->get('pincode_details'); $pincode = $pin_details['pincode']; $city = $pin_details['city']; $latitude = (isset($pin_details['latitude']) && !empty($pin_details['latitude'])) ? $pin_details['latitude'] : '1.0000'; $longitude = (isset($pin_details['longitude']) && !empty($pin_details['longitude'])) ? $pin_details['longitude'] : '1.0000'; } else { $pincode = ''; $city = ""; $latitude = 1.0000; $longitude = 1.0000; } $distance_query = "(6371 * acos(cos(radians(" .$latitude. ")) * cos(radians(`latitude`)) * cos(radians(`longitude`) - radians(" .$longitude. ")) + sin(radians(" .$latitude. ")) * sin(radians(`latitude`))))"; @endphp
{{-- Images Tab Panel --}} @php if (!isset($type)){ $products = \App\Models\Product::where('user_id', optional($shop->user)->id ?? $shop->user_id) ->where('published', 1) ->where('approved', 1) ->orderBy('created_at', 'desc'); $products = $products->select('*')->selectRaw("$distance_query AS distance") ->having("distance","<=",30000); $products = $products->paginate(24); } elseif ($type == 'top-selling'){ $products = \App\Models\Product::where('user_id', optional($shop->user)->id ?? $shop->user_id) ->where('published', 1) ->where('approved', 1) ->orderBy('num_of_sale', 'desc'); $products = $products->select('*')->selectRaw("$distance_query AS distance") ->having("distance","<=",30000); $products = $products->paginate(24); } elseif ($type == 'all-products'){ $products = \App\Models\Product::where('user_id', optional($shop->user)->id ?? $shop->user_id) ->where('published', 1) ->where('approved', 1); $products = $products->select('*')->selectRaw("$distance_query AS distance") ->having("distance","<=",30000); $products = $products->paginate(24); } @endphp @if (!empty($products) && $products->isNotEmpty())
{{-- Heading --}}

@if (!isset($type)) {{ translate('New Arrival Products') }} @elseif ($type == 'top-selling') {{ translate('Top Selling') }} @elseif ($type == 'all-products') {{ translate('All Products') }} @endif

@foreach ($products as $key => $product)
{{-- Product Image --}}
{{ $product->getTranslation('name') }} {{-- Discount Badge --}} @if(discount_in_percentage($product) > 0) {{ translate('OFF') }} {{ discount_in_percentage($product) }}% @endif
{{-- Name --}}

{{ \Illuminate\Support\Str::limit($product->name, 35) }}

{{-- Rating --}}
{{ renderStarRating($product->rating) }}
{{-- Price --}}
@if(home_base_price($product) != home_discounted_base_price($product)) {{ home_base_price($product) }} @endif {{ home_discounted_base_price($product) }}
{{-- Location + Distance Badge --}}
{{ $product->city ?? '' }}@if($product->state ?? false), {{ $product->state }}@endif @if(isset($product->distance) && $product->distance > 0) ๐Ÿ“ {{ number_format($product->distance, 1) }} km @endif
{{-- Shop --}} @php $slug = $product->shop->slug ?? ''; $shopName = $product->shop->name ?? ''; @endphp @if($slug) @endif {{-- Buttons --}} @if(Auth::check())
{{ translate('Contact Seller') }}
@else
{{ translate('Contact Seller') }}
@endif
@endforeach
{{-- Pagination --}}
{{ $products->links() }}
@endif {{-- ============================================================ CUSTOMER REVIEWS SECTION โ€” Drop-in replacement Replace your existing reviews section with this block ============================================================ --}}

{{ translate('Customer Reviews') }}

@php $avgRating = isset($shop->rating) ? (float)$shop->rating : 0; $totalReviews = $shop->totalReviews ?? 0; /* bar percentages per star */ $starCounts = [5=>0, 4=>0, 3=>0, 2=>0, 1=>0]; if(isset($shop->shopReviews) && count($shop->shopReviews) > 0){ foreach($shop->shopReviews as $rv){ $s = (int)($rv->rating ?? 0); if($s >= 1 && $s <= 5) $starCounts[$s]++; } } @endphp {{-- โ”€โ”€ SUMMARY CARD โ”€โ”€ --}}
{{ number_format($avgRating, 1) }}
@php $full = floor($avgRating); $half = ($avgRating - $full) >= 0.5; @endphp @for($i=0; $i<$full; $i++)โ˜…@endfor @if($half)โ˜…@endif @for($i=0; $i < 5-$full-($half?1:0); $i++)โ˜†@endfor
{{ $totalReviews }} {{ $totalReviews == 1 ? 'Review' : 'Reviews' }}
{{-- bars --}}
@foreach([5,4,3,2,1] as $star) @php $pct = $totalReviews > 0 ? round(($starCounts[$star] / $totalReviews) * 100) : 0; @endphp
{{ $star }}โ˜…
@endforeach
{{-- โ”€โ”€ REVIEW CARDS โ”€โ”€ --}} @if(isset($shop->shopReviews) && count($shop->shopReviews) > 0) @foreach($shop->shopReviews as $review)
{{ $review->user->name ?? 'Anonymous' }}
{{ $review->created_at->format('d M Y') }}
@for($i=1; $i<=5; $i++) {{ $i <= (int)$review->rating ? 'โ˜…' : 'โ˜†' }} @endfor

{{ $review->comment ?? '' }}

@endforeach @else

No Reviews Yet. Be The First To Review!

@endif {{-- โ”€โ”€ WRITE REVIEW CARD โ”€โ”€ --}} @php $userReview = null; if(Auth::check() && isset($shop->shopReviews)){ foreach($shop->shopReviews as $rv){ if($rv->user_id == Auth::id()){ $userReview = $rv; break; } } } @endphp {{-- View All Reviews Button --}}
@if($userReview)
Your Review
@for($i=1; $i<=5; $i++) {{ $i <= (int)$userReview->rating ? 'โ˜…' : 'โ˜†' }} @endfor

{{ $userReview->comment }}

@else
Write A Review
@for($r=1; $r<=5; $r++) @endfor
@endif
๐Ÿ“ Shop Location โ€” {{ $shop->name }} @if($shop->user && $shop->user->latitude) GPS: {{ number_format($shop->user->latitude,4) }}, {{ number_format($shop->user->longitude,4) }} @endif
Loading Map...
{{-- Primary: Google Maps embed iframe (works without billing for basic embed) --}} @php $shopLat = optional($shop->user)->latitude ?? null; $shopLng = optional($shop->user)->longitude ?? null; $mapQuery = ($shopLat && $shopLng) ? $shopLat.','.$shopLng : urlencode($shop->address ?? $shop->name); $mapSrc = 'https://maps.google.com/maps?q='.$mapQuery.'&z=15&output=embed&hl=en'; @endphp
โœ… โœ•
{{-- ============================================================ GOOGLE STYLE REVIEWS POPUP @endsection เฐ•เฐฟ เฐฎเฑเฐ‚เฐฆเฑ paste เฐšเฑ‡เฐฏเฐ‚เฐกเฐฟ ============================================================ --}}
{{ $shop->name }}
Customer Reviews
{{ number_format($avgRating,1) }}   @for($i=1;$i<=5;$i++){{ $i<=(int)$avgRating?'โ˜…':'โ˜†' }}@endfor  {{ $totalReviews }} reviews
๐Ÿ”
{{-- โ”€โ”€ CONTACT / CHAT POPUP (Guest Users) โ”€โ”€ --}}
{{-- Phone Step --}}
{{ $shop->name }}
{{ $shop->address ?? '' }}
Contact Seller
Enter Your Mobile Number To Continue
๐Ÿ‡ฎ๐Ÿ‡ณ +91
{{-- Success Step --}}
@include("frontend.partials.enquiry_modal") @endsection @section('style') @endsection @section('script') @endsection