@extends('frontend.layouts.main') @section('title', $seo['title'] ?? '') @section('keywords', $seo['keywords'] ?? '') @section('description', $seo['description'] ?? '') @section('abstract', $seo['abstract'] ?? '') @section('image', asset($seo['image'] ?? '')) @section('canonical') @endsection @section('css') @endsection @section('code_schema') @include('frontend.components.schema.schema-product',['data'=>$data]) @endsection @section('content') @include('frontend.components.breadcrumbs', ['caetgory' => $category, 'parents' => $category->parentsRecursiveLimit(3)])
@php $mediaImages = collect($media)->where('type', 'image')->values(); @endphp @foreach ($mediaImages as $i => $m) @endforeach @if(!empty($data->options) && count($data->options) > 0) @foreach ($data->options as $index => $option) @php $realIndex = $mediaImages->count() + $index; @endphp @endforeach @endif

{{ $data->name }}

@if (!empty($data->masp))
Mã SP: {{ $data->masp }}
@endif
{{$data->comments_count ?? '0' }} đánh giá
@php $stockClass = match($data->stock_status) { 'in_stock' => 'in-stock', 'out_of_stock' => 'out-of-stock', 'preorder' => 'preorder', default => 'unknown', }; $stockText = match($data->stock_status) { 'in_stock' => 'Còn hàng', 'out_of_stock' => 'Hết hàng', 'preorder' => 'Đặt trước', default => 'Không xác định', }; @endphp
{{ $stockText }}
@if($data->price > 0)
Giá bán: {{ number_format($data->price, 0, ',', '.') }} đ
({{ $data->is_vat ? 'Đã' : 'Chưa' }} bao gồm VAT)
@if($data->old_price > 0)
Giá thị trường: {{ number_format($data->old_price, 0, ',', '.') }} đ
@if($data->old_price > 0 && $data->price > 0)
Bạn tiết kiệm: {{ round((($data->old_price - $data->price) / $data->old_price) * 100) }}%
@endif
@endif @elseif($data->old_price > 0)
Giá thị trường: {{ number_format($data->old_price, 0, ',', '.') }} đ
@else
Liên hệ
@endif
@if ($data->options->isNotEmpty()) @php $activated = false; // đánh dấu đã active option nào chưa @endphp
Tùy chọn cấu hình:
@foreach ($data->options as $index=>$option) @php $price = (float) $option->price; $old_price = (float) $option->old_price; $isContact = ($price <= 0); // chỉ active option đầu tiên KHÔNG bị contact $isActive = (!$activated && !$isContact); if ($isActive) $activated = true; $realIndex = $mediaImages->count() + $index; @endphp
{{ $option->size }}
@if ($price > 0)
{{ number_format($price, 0, ',', '.') }} đ
@if ($old_price > 0 )
{{ number_format($old_price, 0, ',', '.') }} đ @if ($old_price > 0 && $old_price > $price) -{{ round((($old_price - $price) / $old_price) * 100) }}% @endif
@endif @else
Liên hệ
@endif
@endforeach
@endif @if (!empty($data->description2))
Mô tả ngắn
{!! $data->description2 !!}
@elseif($data->content2 != "")
Khuyến mãi
{!! $data->content2 !!}
@elseif($gifts)
{{ $gifts->name }}
{!! $gifts->description !!}
@endif
@if($data->price > 0) @else @endif
@if(isset($data->content2) && $data->content2 !="" && $data->description2 != "")
Khuyến mãi
{!! $data->content2 !!}
@endif
@if (isset($salesPolicy) && !empty($salesPolicy))
{{ $salesPolicy->name }}
  • {{ asset($salesPolicy->icon_path) }} {!! $salesPolicy->description !!}
  • {{ asset($salesPolicy->icon_path2) }} {!! $salesPolicy->content !!}
  • {{ asset($salesPolicy->icon_path3) }} {!! $salesPolicy->content2 !!}
  • {{ asset($salesPolicy->icon_path4) }} {!! $salesPolicy->content3 !!}
@endif
Để lại số điện thoại
Tư vấn ngay
@php $hasPhukien = !empty($data->phukien); $hasParameter = !empty($data->description3); $colLg = ($hasPhukien && $hasParameter) ? 6 : 12; @endphp
@if ($hasPhukien)

Mô tả {{ $data->name }}

{!! $data->phukien !!}
@endif @if ($hasParameter)

Thông số {{ $data->name }}

{!! $data->description3 !!}
@endif
@if ($postRelatedProducts->isNotEmpty())

Bài viết về {{$data->name}}

@endif @if (isset($videos) && count($videos) > 0)

Video về {{$data->name}}

@foreach($videos as $video)
@endforeach
@endif

Đánh giá của khách hàng

{{ $data->rating }} / 5
{{ $data->comments_count }} lượt đánh giá
@foreach ([5,4,3,2,1] as $star)
{{ $star }}
{{ $data->{'star_'.$star.'_count'} }}
@endforeach

{{ $data->comments_count }} Bình luận

@if ($data->comments->isNotEmpty())
@foreach($data->comments as $comment) @include('frontend.components.comments.item', ['comment' => $comment]) @endforeach
@endif
@if ($data->faqs->isNotEmpty())

Câu hỏi thường gặp {{ $data->name }}

@foreach ($data->faqs as $faq)
{{ $faq->question }}
{!! $faq->answer !!}
@endforeach
@endif
@if (!empty($videos)) @endif @endsection @section('js') @endsection