@extends('partial.layout') @section('content') @php $amazingDiscountModel = null; $amazingCountdownEnd = null; if (isset($product)) { $now = now(); $normalizeDiscount = function ($discount) use ($now) { if (!$discount || $discount->type !== 'amazing') { return null; } $endAt = \Illuminate\Support\Carbon::parse($discount->end_time); if ($endAt->lessThanOrEqualTo($now)) { return null; } if (!empty($discount->start_time)) { $startAt = \Illuminate\Support\Carbon::parse($discount->start_time); if ($startAt->greaterThan($now)) { return null; } } return $discount; }; if ($product->relationLoaded('discount')) { $amazingDiscountModel = $normalizeDiscount($product->getRelation('discount')); } if (!$amazingDiscountModel) { $amazingDiscountModel = $normalizeDiscount( $product->discount() ->where('type', 'amazing') ->where('start_time', '<=', $now) ->where('end_time', '>', $now) ->latest('end_time') ->first() ); } if (!$amazingDiscountModel) { $items = $product->relationLoaded('productItem') ? $product->getRelation('productItem') : $product->productItem() ->whereHas('discount', function ($query) use ($now) { $query->where('type', 'amazing') ->where('start_time', '<=', $now) ->where('end_time', '>', $now); }) ->with(['discount' => function ($query) use ($now) { $query->where('type', 'amazing') ->where('start_time', '<=', $now) ->where('end_time', '>', $now); }]) ->get(); foreach ($items as $item) { $itemDiscount = $item->relationLoaded('discount') ? $normalizeDiscount($item->getRelation('discount')) : $normalizeDiscount( $item->discount() ->where('type', 'amazing') ->where('start_time', '<=', $now) ->where('end_time', '>', $now) ->latest('end_time') ->first() ); if ($itemDiscount) { $amazingDiscountModel = $itemDiscount; break; } } } if ($amazingDiscountModel) { $discountEnd = \Illuminate\Support\Carbon::parse($amazingDiscountModel->end_time); if ($discountEnd->greaterThan($now)) { $amazingCountdownEnd = $discountEnd->toIso8601String(); } } } $hasAmazingDiscount = !empty($amazingCountdownEnd); @endphp

{{$product->title}} کد {{$product->vendor_code}}

@if($hasAmazingDiscount) @include('components.front.countdown.assets')
پیشنهاد شگفت‌انگیز فرصت باقی‌مانده برای خرید با تخفیف ویژه
00 روز
00 ساعت
00 دقیقه
00 ثانیه
@endif

دسته بندی محصول : {{$product->category->title}}

@php $approvedComments = $product->comments()->where('is_question', 0)->where('status', 1)->get(); $averageRate = $approvedComments->avg('rate') ?? 0; $commentCount = $approvedComments->count(); @endphp {{ number_format($averageRate, 1) }} (امتیاز از {{$commentCount}} نظر) {{ $commentCount }} دیدگاه
@if($product->category->title != 'کارت هدیه')

برند : {{$product->brand->title}}

@php $items = $product->productItem ?? collect(); // حذف وزن‌های تکراری (فقط یکی از هر وزن) $uniqueWeights = $items->unique('weight')->values(); @endphp @if($uniqueWeights->count() > 0) @else

وزن کالا : {{ $product->default_weight }} گرم

@endif

ویژگی ها

عیار

{{$product->karat->title}}

مناسب برای

@if(count($product->productUsage) > 0) @foreach($product->productUsage as $key => $proUsage) {{$proUsage->title}} {{$key !== count($product->productUsage) -1 ? ',' : ''}} @endforeach @else - @endif

@endif @if(isset($features) && $features != null && count($features) > 0)

ویژگی ها

@foreach($features as $feature)

{{ $feature['title'] }}

{{ $feature['value'] }}

@endforeach
@endif
قیمت
@if($product->status == 0) توقف تولید @else @php // اگر محصول ProductItem دارد، از اولین آیتم استفاده کن $displayPrice = $product->product_price; $displayFinalPrice = $product->final_price; $displayHasDiscount = $product->has_discount; $displayDiscountPercent = $product->discount_percent; if ($product->productItem()->available()->count() > 0) { $firstItem = $product->productItem()->available()->first(); $displayPrice = $firstItem->price; $displayFinalPrice = $firstItem->final_price; $displayHasDiscount = $firstItem->has_discount; $displayDiscountPercent = $firstItem->discount_percent ?? 0; } @endphp @if($displayPrice == 0) به زودی ... @else @if($displayHasDiscount) {{ number_format($displayFinalPrice) }} ریال {{ $displayDiscountPercent }}%

{{ number_format($displayPrice) }} ریال

@else {{ number_format($displayPrice) }} ریال @endif @endif @endif
گارانتی اصالت و سلامت فیزیکی کالا
@if(isset($product->productItem) && $product->productItem != null && count($product->productItem) > 0 && $product->status == 1 ) کالا موجود می باشد @elseif($product->status == 1) آماده ارسال از {{$product->time_to_create}} روز کاری دیگر @else تولید این محصول متوقف شده است @endif
@if($product->status !== 0 && $product->product_price != 0) @else @endif
پرداخت مطمئن پرداخت مطمئن
۱ روز ضمانت بازگشت ۱ روز ضمانت بازگشت
گارانتی مادام العمر گارانتی مادام العمر
ضمانت اصل بودن کالا ضمانت اصل بودن کالا
تضمین کیفیت تضمین کیفیت
پرداخت مطمئن پرداخت مطمئن
۱ روز ضمانت بازگشت ۱ روز ضمانت بازگشت
گارانتی مادام العمر گارانتی مادام العمر
ضمانت اصل بودن کالا ضمانت اصل بودن کالا
تضمین کیفیت تضمین کیفیت
@if(isset($similar_products) && count($similar_products))
محصولات مشابه
@foreach($similar_products as $similar_product)
@endforeach
@endif
{!! $product->description !!}
  • کد محصول

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

  • ابعاد

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

  • مدل

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

  • جواهر

    {{$product->is_jewelry ? 'بله' : 'خیر'}}

  • جنس

    {{$product->productType->title ?? '-'}}

  • عیار

    {{$product->karat->title ?? '-'}}

  • رنگ آبکاری

    {{$product->color->title ?? '-'}}

  • مناسب برای

    @foreach($product->productUsage as $key => $proUsage) {{$proUsage->title}} {{$key !== count($product->productUsage) -1 ? ',' : ''}} @endforeach

  • توضیحات

    {!! $product->short_description ?? '-' !!}

@forelse($product->comments()->where('is_question', 0)->where('status', 1)->orderBy('created_at', 'desc')->get() as $comment)
@if($comment->rate)
@for($i = 1; $i <= 5; $i++) @endfor
@endif

{{ $comment->comment }}

@empty

هنوز هیچ نظری برای این محصول ثبت نشده است.

@endforelse

ثبت نظر جدید

@for($i = 5; $i >= 1; $i--) @endfor
@forelse($product->comments()->where('is_question', 1)->where('status', 1)->orderBy('created_at', 'desc')->get() as $question)

{{ $question->comment }}

@if($question->response)
پاسخ فروشگاه

{{ $question->response }}

@endif
@empty

هنوز هیچ پرسشی برای این محصول ثبت نشده است.

@endforelse

ثبت پرسش جدید

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