@extends('layouts.page') @section('head') @include('elements.seo', [ 'title'=>$product->name, 'description'=> $product->sort_description ]) @endsection @section('content')
@php $variationImageByItem = $product->images ->whereNotNull('variation_item_id') ->groupBy('variation_item_id') ->map(function ($images) { $firstImage = $images->sortBy('position')->first(); return $firstImage ? asset('storage/' . $firstImage->path) : null; }); $productImagesPayload = $product->images ->sortBy('position') ->values() ->map(function ($image) { return [ 'url' => asset('storage/' . $image->path), 'variation_item_id' => $image->variation_item_id, ]; }) ->values() ->all(); @endphp
@if($product->images->first()) {{ $product->name }} @endif
    @foreach ($product->images as $index => $image)
  • {{ $product->name }}
  • @endforeach
@csrf

{{$product->name}}

@if($product->sku)

{{$product->sku}}

@endif @php $inventoryEnabled = \App\Models\Setting::getByKey('inventory_enabled'); $showInventory = ($inventoryEnabled === '1' || $inventoryEnabled === 1 || $inventoryEnabled === true); $isManaged = $product->isInventoryManaged(); $displayBodegaCode = auth()->check() ? ($bodegaCode ?? null) : 'MDTAT'; $preferredVariationItemId = $product->preferredVariationItemIdForBodega($displayBodegaCode); // Use orderable stock (available - safety) for client-facing display $orderableStock = auth()->check() ? $product->getOrderableStockForBodega($bodegaCode ?? null, $preferredVariationItemId) : $product->getOrderableStockForBodega('MDTAT', $preferredVariationItemId); @endphp @if($showInventory && $isManaged)

Disponibilidad: @auth {{ number_format($orderableStock) }} unidades @else Disponible @endauth

últimas unidades disponibles

Producto no disponible para tu ubicación

@endif @if($product->short_description)

{{ $product->short_description }}

@endif @php $firstEnabledItem = $preferredVariationItemId ? $product->items->firstWhere('id', $preferredVariationItemId) : $product->items->where('pivot.enabled', 1)->first(); $displayFinal = $product->final_price; if ($firstEnabledItem) { $displayFinal = $product->getFinalPriceForUser(false, null, $firstEnabledItem->id); } @endphp
${{ currency($displayFinal['price']) }}
@if($displayFinal['perItemPrice'])

(Und. x) ${{ currency($displayFinal['perItemPrice']) }}

@endif
@if($product->brand)

{{$product->brand->name}}

@endif @if($product->category)

{{$product->category->name}}

@endif
@if ($product->variation && $product->items->count())
{{ $product->variation->name }}:
@endif
@php $vacationInfo = \App\Models\Setting::getVacationModeInfo(); $isVacationMode = $vacationInfo['active']; $formattedVacationDate = $vacationInfo['formatted_date'] ?? 'pronto'; @endphp
@if($isVacationMode)

Tuti está de vacaciones. Te esperamos nuevamente {{ $formattedVacationDate }}. ¡Gracias!

@endif @php $hasPdf = !empty($product->specifications_pdf); @endphp
@if($hasPdf)
Ficha Técnica
@else
Ficha Técnica
@endif
@php $hasDetails = $product->description || $product->technical_specifications || $product->warranty || $product->other_information; @endphp @if($hasDetails)
@if($product->description)
{!! $product->description !!}
@endif @if($product->technical_specifications)
@endif @if($product->warranty)
@endif @if($product->other_information)
@endif
@endif @if($related->count())

Complementa tu compra

@endif @if(count($intermedio) > 0 || count($lateral) > 0)
@if(count($intermedio) > 0)
    @foreach ($intermedio as $banner)
  • @endforeach
@endif @if(count($lateral) > 0)
    @foreach ($lateral as $banner)
  • @endforeach
@endif
@endif
@endsection @section('scripts') @endsection