@extends('layout.front.master')
@section('title', ($product->name ?? 'Producto') . ' | ' . config('site.name', 'CD-System'))
@section('description', \Illuminate\Support\Str::limit($product->description ?? '', 160))
@push('head')
{{-- Structured Data para SEO --}}
@endpush
@section('content')
@php
$moduleConfig = get_module_page_header_config('products');
$pageTitle = $product->name ?? $moduleConfig['title'];
$pageSubtitle = isset($product->category) ? 'Equipo de ' . $product->category->name : $moduleConfig['subtitle'];
// Usar imagen del producto si existe, sino usar imagen por defecto
$backgroundImage = null;
if ($product->images->count() > 0) {
$firstImage = $product->images->first();
$imagePath = $firstImage->image_path;
if (!\Illuminate\Support\Str::startsWith($imagePath, ['http://', 'https://', '/'])) {
$backgroundImage = asset($imagePath);
} else {
$backgroundImage = $imagePath;
}
} else {
// Imagen por defecto
$backgroundImage = asset('cd-project/img/demos/transportation-logistic/generic/generic-1.png');
}
@endphp
@if(view()->exists('modules.products.frontend.partials.dynamic-header'))
@include('modules.products.frontend.partials.dynamic-header', [
'product' => $product,
'backgroundImage' => $backgroundImage
])
@else
{{-- Fallback a header moderno si no existe el dinámico --}}
{{ __('Imagen no disponible') }}
${{ number_format($product->price ?? 0, 2, ',', '.') }}
{{ $product->description }}
| {{ __('Categoría') }}: | {{ $product->category->name ?? 'N/A' }} |
|---|---|
| {{ __('Características') }}: | @foreach($product->tags as $tag) {{ $tag->name }} @endforeach |
| {{ __('Documentación') }}: | {{ __('Ver especificaciones técnicas completas') }} |
{{ __('Explora otras categorías para descubrir más productos.') }}