@extends('frontend::layouts.master') @push('styles') @endpush @section('content')
@if (!empty($detail['gallery'][0])) @php $badge = empty($detail['tag']) ? null : [ 'label' => implode(', ', array_column($detail['tag'], 'name')), 'class' => in_array(1, array_column($detail['tag'], 'id')) ? 'bg-gray-500' : 'bg-red-500', ]; @endphp @if (!empty($badge))
{{ $badge['label'] ?? '' }}
@endif
@foreach ($detail['gallery'] as $key => $item)
{{ $item['name'] ?? '' }}
@endforeach
@foreach ($detail['gallery'] as $key => $item)
{{ $item['name'] ?? '' }}
@endforeach
@endif
{{ __('frontend::lang.label.remaining') }}: {{ $detail['stock'] ?? 0 }} SKU: {{ $detail['sku'] ?? '' }}

{{ $detail['name'] ?? '' }}

{{ __('frontend::lang.label.categories') }}: @foreach ($detail['category'] as $item) {{ $item['name'] ?? '' }} @if (!$loop->last) @endif @endforeach

{{ __('frontend::lang.label.manufacturer') }}: {{ $detail['manufacturer'] ?? '' }}

{{ $detail['desc'] ?? '' }}

@if (!empty($detail['size']))
{{ __('frontend::lang.label.pack_size') }}
{!! $detail['size'] ?? '' !!}
@endif @if (!empty($detail['unit']))
{{ __('frontend::lang.label.unit_type') }}
{!! $detail['unit'] ?? '' !!}
@endif
@php $price = $detail['price']['price'] ?? '0.00'; $priceDiscount = $detail['price']['price_discount'] ?? '0.00'; $hasDiscount = $priceDiscount != '0.00'; $displayPrice = $hasDiscount ? $priceDiscount : $price; $save = $hasDiscount ? $price - $priceDiscount : 0; @endphp {{ $displayPrice ?? '0.00' }} @if ($hasDiscount) {{ $price ?? '0.00' }} ({{ __('frontend::lang.label.save') }}: {{ $save ?? '0.00' }} {{ __('frontend::lang.label.baht') }}) @endif
@if (auth()->guard('member')->check() && $detail['stock'] > 0) @else
@endif
@php $chk_tabs = []; foreach (['information', 'component', 'indication', 'take', 'storage'] as $item) { if (!empty($detail[$item])) { $chk_tabs[] = $item; } } @endphp @if (!empty($chk_tabs[0]))
@foreach ($chk_tabs as $key => $item) @endforeach
@foreach ($chk_tabs as $key => $item)
{!! $detail[$item] ?? '' !!}
@endforeach
@endif @if (!empty($detail['related'][0]))

{{ __('frontend::lang.label.related_products') }}

@foreach ($detail['related'] as $product) @endforeach
@endif
@endsection @push('scripts') @endpush