@extends('layouts.mobile') @php $ogProductImage = $product->getPrimaryImage(); if ($ogProductImage && !filter_var($ogProductImage, FILTER_VALIDATE_URL)) { $ogProductImage = url($ogProductImage); } @endphp @section('meta_title', $product->name . ' - Buy Online at Gletra Mobile') @section('meta_description', Str::limit(strip_tags($product->description), 160)) @section('meta_image', $ogProductImage) @push('scripts') @endpush @php $salePrice = $product->sale_price ?? $product->price; $inCart = auth()->check() && auth()->user()->cart()->where('product_id', $product->id)->exists(); $cartUrl = route('mobile.cart'); $loginUrl = route('login') . '?redirect=' . urlencode(url()->current()); @endphp @section('content')
Product Details
{{-- Primary Image --}} @if($product->primary_image)
{{ $product->name }}
@endif {{-- Gallery Images --}} @foreach($product->galleries as $gallery)
{{ $product->name }}
@endforeach {{-- Legacy Images --}} @if(!$product->primary_image && $product->galleries->count() == 0) @forelse($product->images as $image)
{{ $product->name }}
@empty
@endforelse @endif
@php $hasNewGallery = $product->primary_image || $product->galleries->count() > 0; @endphp @if($hasNewGallery || $product->images->count() > 1)
@if($product->primary_image)
@endif @foreach($product->galleries as $gallery) @php $idx = $product->primary_image ? $loop->iteration : $loop->index; @endphp
@endforeach @if(!$hasNewGallery) @foreach($product->images as $image)
@endforeach @endif
@endif

{{ $product->name }}

@if($product->short_description)

{{ $product->short_description }}

@endif
₹{{ number_format($product->sale_price ?? $product->price, 0) }} ₹{{ number_format($product->price, 0) }}
{{ number_format($product->approvedReviews->avg('rating') ?? 4.2, 1) }} {{ $product->approvedReviews->count() }} Ratings
Free Delivery Cash on Delivery @if($product->vendor?->user_id) @auth Chat with Seller @else Chat with Seller @endauth @endif
@if($product->variants->count() > 0)
@include('partials.product-variant-selector')
@endif @php $approvedReviews = $product->approvedReviews; $photoReviewCount = $approvedReviews->filter(fn($r) => $r->hasPhotos())->count(); $reviewCount = $approvedReviews->count(); @endphp

{{ $product->description ?: 'No detailed description available for this product.' }}

@auth @endauth @if($product->stock_qty > 0)
@auth @else @endauth
@else
Currently Out of Stock
@endif @push('scripts') @include('partials.product-share') @endpush @endsection