@extends('front.include.app') @section('content')

{{ isset($product) && $product->slug ? $product->product_name : 'Product Details' }}

Main Product Image
@foreach ($product->variations as $variationImg) @if ($variationImg->productVariationImage()->first())
variation_image
@endif @endforeach @foreach ($product->productGalleryImages() as $file)
variation_image
@endforeach
Main Product Image
@foreach ($product->variations as $variationImg) @if ($variationImg->productVariationImage()->first())
variation_image
@endif @endforeach @foreach ($product->productGalleryImages() as $file)
Product Image
@endforeach

{{ $product->product_name ?? '' }}

@php $avg = $averageRating ?? 0; @endphp @for ($i = 5; $i >= 1; $i--) @endfor
({{ $totalReviewsCount ?? 0 }})
  • Price:CAD ${{ $product->price ?? '' }}
{!! $product->description ?? '' !!}
  • Status: @if($product->variations->isEmpty()) {{ $product->stock > 0 ? 'In Stock' : 'Sold Out' }} @else @php // $selectedVariationId should be set from controller or JS (hidden input) $selectedVariationId = old('product_variation_id') ?? null; $selectedVariation = $selectedVariationId ? $product->variations->where('id', $selectedVariationId)->first() : null; @endphp @if($selectedVariation) {{ $selectedVariation->quantity > 0 ? 'In Stock' : 'Sold Out' }} @else {{ $product->variations->every(fn($variation) => $variation->quantity <= 0) ? 'Sold Out' : 'In Stock' }} @endif @endif
@php $firstTimeDiscount = $product->first_time_discount ?? 0; $repeatDiscount = $product->repeat_order_discount ?? 0; @endphp @if (Auth::check()) @php $userHasPurchased = \App\Models\OrderItem::whereHas('order', function ($q) { $q->where('user_id', Auth::id()); }) ->where('product_id', $product->id) ->exists(); @endphp @if (!$userHasPurchased && $firstTimeDiscount > 0)

{{ $firstTimeDiscount }} % Take a picture with your Upsence product and email at info@upsence.com and get exclusive 10% dicount on your next order

@elseif($userHasPurchased && $repeatDiscount > 0)

🔁 {{ $repeatDiscount }}% Returning Customer Discount!

@endif @else @if ($firstTimeDiscount > 0)

Take a picture with your Upsence product and email at info@upsence.com and get exclusive 10% dicount on your next order

@endif @endif
@if ($hasSize && $sizes->isNotEmpty()) @elseif($colors->isNotEmpty()) @endif
@if ($product->stock >= 1 || $product->variations->sum('quantity') > 0)

Quantity

  • -
@php @endphp
@if ($product->category_id == $selected_category?->id) @endif
@endif

Description

{!! $product->description ?? 'No description available.' !!}

@auth

Write a Review

@csrf
    @for ($i = 1; $i <= 5; $i++)
  • @endfor
@php $review = App\Models\Review::query() ->where('product_id', $product->id) ->where('user_id', Auth::id()) ->first(); @endphp {{-- @if (!$review)--}} {{-- @endif--}} @if ($review) @endif
@endauth

Customer Reviews

@php $hasRealReviews = isset($productTestimonials) && $productTestimonials->count() > 0; $hasFakeReviews = isset($fakeReviews) && $fakeReviews->count() > 0; $hasAnyReviews = $hasRealReviews || $hasFakeReviews; @endphp @if($hasAnyReviews) @if($hasRealReviews) @foreach($productTestimonials as $testimonial)
{{ $testimonial->user->first_name ?? 'Anonymous' }}
{{ formatReviewTime($testimonial->created_at) }}

{{ $testimonial->review }}

@for ($i = 1; $i <= $testimonial->rating; $i++) @endfor @for ($i = $testimonial->rating + 1; $i <= 5; $i++) @endfor
@endforeach @endif @if($hasFakeReviews) @foreach($fakeReviews as $fakeReview)
{{ $fakeReview->username }}
{{ formatReviewTime($fakeReview->created_at) }}

{{ $fakeReview->review }}

@for ($i = 1; $i <= $fakeReview->stars; $i++) @endfor @for ($i = $fakeReview->stars + 1; $i <= 5; $i++) @endfor
@endforeach @endif @else
No reviews available yet. Be the first to review!
@endif
×
UPSENCE - Size Guide

HOW TO MEASURE MY FINGER?

@endsection @push('custom-scripts') @endpush