@extends('front_end.template.layout') @section('content')
@php $imageString = $product->image; $images = explode(',', $imageString); $firstImage = get_uploaded_image_url($images[0],'product_image_upload_dir'); @endphp
@foreach($sproduct['product_images'] ?? [] as $image) @if(!empty($image) ) @endif @endforeach @if(!empty($video_url)) @php $videoURL = !empty($video_url) ? get_uploaded_image_url($video_url, 'product_image_upload_dir') : ''; $video_thumbnail = !empty($video_thumbnail) ? get_uploaded_image_url($video_thumbnail, 'product_image_upload_dir') : ''; @endphp
@endif
@foreach($sproduct['product_images'] as $image) @if(!empty($image) )
@endif @endforeach @if(!empty($video_url)) @php $videoURL = !empty($video_url) ? get_uploaded_image_url($video_url, 'product_image_upload_dir') : ''; @endphp
@endif

{{ $sproduct['product_name'] }}

@php $rating = $product->average_rating; $ratedUsers = $product->rated_users; @endphp @php $store = isset($vendor->stores) && $vendor->stores->first() ? $vendor->stores->first() : null; @endphp

by: @if ($store) {{ $store->store_name ?? 'N/A' }} @else N/A @endif

@if($product->product_type == 2 && isset($sproduct['product_variations'])) @php $selectedColor = request()->get('color'); $selectedSize = request()->get('size'); $defaultColor = null; $defaultSize = null; if (!empty($sproduct['selected_attribute_list'])) { foreach ($sproduct['selected_attribute_list'] as $attr) { if (strtolower($attr->attribute_name) == 'color') { $defaultColor = $attr->attribute_values_id; } elseif (strtolower($attr->attribute_name) == 'size') { $defaultSize = $attr->attribute_values_id; } } } @endphp @foreach($sproduct['product_variations'] as $variation) @php $attrName = strtolower($variation['attribute_name']); $inputName = 'colorsattr' . $variation['attribute_name']; $selectedValue = null; if ($attrName === 'color') { $selectedValue = $selectedColor ?? $defaultColor; } elseif ($attrName === 'size') { $selectedValue = $selectedSize ?? $defaultSize; } $variation_type = (isset($sproduct['product_variations'][0]) && isset($sproduct['product_variations'][1])) ? 'multiple' : 'single'; if ($variation_type == 'single' && empty($selectedColor) && empty($selectedSize)) { $selectedValue = $sproduct['product_variant_id'] ?? $defaultSize; } @endphp
@endforeach @endif
    @foreach($features as $feature)
  • @endforeach
@php $regularPrice = $sproduct['regular_price']; $salePrice = $sproduct['sale_price']; $discount = 0; // Calculate discount percentage if there's a sale price if ($salePrice && $regularPrice > $salePrice) { $discount = round((($regularPrice - $salePrice) / $regularPrice) * 100); $saveAmount = $regularPrice - $salePrice; } @endphp
Regular price @if ($salePrice && $salePrice < $regularPrice) {{ number_format($regularPrice, 2) }} AED {{ number_format($salePrice, 2) }} AED @php $saveAmount = $regularPrice - $salePrice; $discount = round(($saveAmount / $regularPrice) * 100); // Calculate the percentage discount @endphp | Save: {{ number_format($saveAmount, 2) }} AED ({{ $discount }}% OFF) @else {{ number_format($regularPrice, 2) }} AED @endif
@if($product->personalisation==1)

@endif
@if($stock > 0) In stock @else Sold out @endif Pre-order Now Sold out Order now, Only 10 left!
@if (isset($vendor->stores) && $vendor->stores->first() && file_exists(public_path('storage/' . $vendor->stores->first()->logo))) @else @endif

{{ isset($vendor->stores) && $vendor->stores->first() && isset($vendor->stores->first()->store_name) && $vendor->stores->first()->store_name ? $vendor->stores->first()->store_name : 'N/A' }}

{{ isset($vendor->stores) && $vendor->stores->first() && isset($vendor->stores->first()->location) && $vendor->stores->first()->location ? $vendor->stores->first()->location : 'N/A' }}

4.5 @if (isset($vendor->stores) && $vendor->stores->first() && isset($vendor->stores->first()->vendor_id) && !empty($vendor->stores->first()->vendor_id)) View Store @endif
@if (isset($vendor->stores) && $store = $vendor->stores->first()) @php $deliveryType = $store->delivery_type ?? 'standard'; $standardText = $store->standard_delivery_text ?? ''; $minDays = $store->delivery_min_days; $maxDays = $store->delivery_max_days; @endphp
{{-- Always show standard delivery --}}

Standard Delivery : {{ $standardText }}

{{-- Show custom delivery details only if personalisation is enabled --}} @if ($product->personalisation == 1 ) @if (!empty($minDays) && !empty($maxDays)) @else

Estimated Delivery: Information not available

@endif @endif
@endif

{{$product->shipment_and_policies}}
@php $nextProductimage = explode(',', $nextProductInfo->image); $prevProductimage = explode(',', $prevProductInfo->image); @endphp {{$prevProductInfo->product_name}} AED{{$prevProductInfo->sale_price}} product product {{$nextProductInfo->product_name}} AED{{$nextProductInfo->sale_price}}

Description

    @foreach($features as $feature)
  • @if($feature->feature_title=='') {{ $feature->name }} @else {{ $feature->name }}: {{ $feature->feature_title }} @endif
  • @endforeach

Shipping and Policies

{{$product->shipment_and_policies}}

Review

Write A Review

Customer Reviews

@foreach($reviews as $review)
@for ($i = 1; $i <= 5; $i++) @endfor
{{ $review->title }}

{{ $review->comment }}

@endforeach

You May Also Like

@foreach($relatedProducts as $product)
@php $images = explode(',', $product->image); $firstImage = $images[0]; @endphp image image
@php $userLoggedIn = auth()->check(); $userRole = $userLoggedIn ? auth()->user()->role : null; $loginUrl = route('login'); @endphp @if (isset($product->added_to_wishlist) && $product->added_to_wishlist == 1) Available in Wishlist @else Add To Wishlist @endif
@if($product->regular_price) @if($product->sale_price && $product->sale_price < $product->regular_price)
Sale Price: AED {{ $product->sale_price ?? 'N/A' }}
Regular Price: AED {{ $product->regular_price }}
@else
Price: AED {{ $product->regular_price }}
@endif @else
Price: Not available
@endif
@for($i = 1; $i <= 5; $i++) @if($product->average_rating >= $i) @elseif($product->average_rating >= $i - 0.5) @else @endif @endfor
@endforeach

Recently Viewed Products

@foreach($recentlyviewedproducts as $product)
@php $images = explode(',', $product->image); $firstImage = $images[0]; @endphp image image
@php $userLoggedIn = auth()->check(); $userRole = $userLoggedIn ? auth()->user()->role : null; $loginUrl = route('login'); @endphp @if (isset($product->added_to_wishlist) && $product->added_to_wishlist == 1) Available in Wishlist @else Add To Wishlist @endif
@if($product->regular_price) @if($product->sale_price && $product->sale_price < $product->regular_price)
Sale Price: AED {{ $product->sale_price ?? 'N/A' }}
Regular Price: AED {{ $product->regular_price }}
@else
Price: AED {{ $product->regular_price }}
@endif @else
Price: Not available
@endif
@for($i = 1; $i <= 5; $i++) @if($product->average_rating >= $i) @elseif($product->average_rating >= $i - 0.5) @else @endif @endfor
@endforeach
@endsection @section('script') @endsection