@extends('layouts.frontend.app') @section('content')
@php $images = is_array($product['product_image']) ? $product['product_image'] : explode(',', $product['product_image']); @endphp
@if(count($images) > 1) @foreach($images as $img) @endforeach @endif

{{ $product['product_name']}} {{ $product['product_format']}} – {{ $product['publication_date']}}

by {{$product['product_book_author']}} (Author)
|

{{ number_format($averageRating, 1) }} @for ($i = 1; $i <= 5; $i++) @if ($i <= floor($averageRating)) @elseif ($i - $averageRating <= 0.5) @else @endif @endfor ({{ $totalReviews }})

{{ ($product['product_available'] ?? 0) > 0 ? "Available" : "Out Of Stock" }}

Ships within {{ $product['ships_within'] }}

@if(Auth::check() && ($product['product_available'] ?? 0) <= 0) Notify Me @endif
@php $desc = strip_tags($product['title_description']); $words = explode(' ', $desc); @endphp

{!! implode(' ', array_slice($words, 0, 50)) !!} @if(count($words) > 50) ... Read More @endif

{{-- View All --}}
@if(!empty($product['total_discount_price']))

{{$product['product_discount_price']}}% OFF

M.R.P. ₹{{ number_format($product['product_price']),2 }}
₹{{ number_format($product['total_discount_price']), 2 }}

@else

M.R.P. ₹{{ number_format($product['total_discount_price']), 2 }}

@endif

Inclusive of all taxes

FREE delivery {{ $deliveryEstimate['estimated_date'] }}.

@if(Auth::check())

Deliver to {{ $deliveryEstimate['user_name'] }} {{ $deliveryEstimate['city'] }} {{ $deliveryEstimate['pincode'] }}

@else

to see delivery info

@endif

Delivered by popconcult

Sold by {{$product['seller_name']}}

Payment Secure transaction

@if($product['product_stock_quantity'] > 0) @if(Auth::check()) @else @endif @else @endif
Product description

{!! $product['title_description'] !!}

About the Author

{{$product['product_book_author']}} {!! $product['author_details'] !!}

Best Sellers

View All
@if(count($bestSellers) > 0) @foreach ($bestSellers as $pro)
@if(!empty($pro['total_discount_price']))
{{ $pro['product_discount_price'] ?? ''}}%
@else @endif

{{ Str::limit($pro['product_name'] ?? '', 25, '..') }}

{{ Str::limit($pro['product_sub_title'] ?? '', 20, '..') }}

{{ $pro['product_book_author'] }}
@for($i = 1; $i <= 5; $i++) @if($i <= $pro['rating']) @else @endif @endfor
@if(!empty($pro['total_discount_price'])) ₹{{ number_format($pro['total_discount_price']), 2 }} ₹{{ number_format($pro['product_price']), 2 }} @else ₹{{ number_format($pro['product_price']), 2 }} @endif
@if($pro['product_stock_quantity'] > 0) @if(Auth::check()) {{-- Logged-in & In Stock --}} Shop Now @else {{-- Guest & In Stock --}} Shop Now @endif @else {{-- Out of Stock (All Users) --}}
Out of Stock @if(Auth::check()) {{-- Logged-in users only --}} Notify Me @endif
@endif
@endforeach @endif
Product Details

ISBN-13: {{ $product['product_isbn_13'] }}

ISBN-10: {{ $product['product_isbn_10'] }}

Publisher: {{$product['product_publisher_name']}}

Weight: {{$product['weight']}}

Publisher Date: {{$product['publication_date']}}

Binding: {{$product['product_format']}}

{{--

Depth: {{$product['product_width']}}

--}}

Language: {{$product['product_language']}}

Height: {{$product['product_height']}}

No of Pages: {{$product['product_page_count']}}

Width: {{$product['product_width']}}

{{-- Review Summary --}}
Customer Reviews ({{ $totalReviews }})
{{ number_format($averageRating, 1) }}
@for ($i = 1; $i <= 5; $i++) @if ($i <= floor($averageRating)) @elseif ($i - $averageRating <= 0.5) @else @endif @endfor
Based on {{ $totalReviews }} reviews
@for ($i = 5; $i >= 1; $i--) @php $count = $starCounts[$i] ?? 0; $percentage = $totalReviews ? ($count / $totalReviews) * 100 : 0; @endphp
{{ $i }} star{{ $i > 1 ? 's' : '' }}
{{ $count }}
@endfor
{{-- Review List --}}
@forelse($reviews as $review)
Reviewer
{{ ucwords($review->name) ?? $review->user->name }}
{{formatCustomDate($review->created_at) }}
@for ($i = 1; $i <= 5; $i++) @endfor
{{ $review->title }}

{!! $review->review !!}

@empty

No reviews yet.

@endforelse
{{-- Review Form --}}

Write a Review

@csrf
@foreach(range(5, 1) as $star) @endforeach
@if (Auth::check()) @else @endif
{{-- ======product zoom script========== --}} @endsection