@extends('frontend.layouts.app') @section('contents') @php $currencyIcon = \App\Models\Setting::where('key', 'site_currency_icon')->value('value'); @endphp

{{ $product->name }}

({{ $product->reviews_count }} reviews)
@php // Decide price source (variant OR product) $price = $product->primaryVariant?->price ?? $product->price; $special = $product->primaryVariant?->special_price ?? $product->special_price; // Calculate discount $discount = ($special > 0 && $price > 0) ? round((($price - $special) / $price) * 100) : 0; @endphp @if ($special > 0) {{-- Selling Price --}} {{ $currencyIcon }}{{ number_format($special, 2) }} {{-- MRP --}} {{ $currencyIcon }}{{ number_format($price, 2) }} {{-- Discount --}} @if ($discount > 0) {{ $discount }}% OFF @endif @else {{-- Regular Price --}} {{ $currencyIcon }}{{ number_format($price, 2) }} @endif

{!! $product->short_description !!}

@foreach ($product->attributeWithValues as $attribute)
{{ $attribute->name }}:
    @foreach ($attribute->values as $value) @if ($attribute->type == 'color')
  • @else
  • {{ $value->value }}
  • @endif @endforeach
@endforeach @if ($product->primaryVariant) @endif
{!! $product->description !!}
    @if ($product->store->address)
  • Address: {{ $product->store->address }}
  • @endif @if ($product->store->phone)
  • Phone: {{ $product->store->phone }}
  • @endif @if ($product->store->email)
  • Phone: {{ $product->store->email }}
  • @endif

{{ $product->store->short_description }}

Customer Reviews

@forelse($reviews as $review)
{{ date('F d Y', strtotime($review->created_at)) }}

{{ $review->review }}

@empty
No reviews found
@endforelse
{{ $reviews->links() }}

Customer reviews

{{ round($avgRating, 1) }} out of 5
@foreach(range(5, 1) as $star) @php $count = $reviewGroup[$star] ?? 0; $percent = $totalReviews > 0 ? ($count / $totalReviews) * 100 : 0; @endphp
{{ $star }} star
{{ $percent }}%
@endforeach

Add a review

@csrf @guest
@endguest

Related products

@endsection @push('styles') @endpush @push('scripts') @endpush