@extends('ecommerce::layouts.layout_ecommerce_item.record') @section('content') @php $configurationModel = \App\Models\Tenant\Configuration::first(); $ecommerceConfiguration = \App\Models\Tenant\ConfigurationEcommerce::first(); $phoneWhatsapp = $ecommerceConfiguration->phone_whatsapp ?? $configurationModel->phone_whatsapp ?? null; $defaultImage = $configurationModel->product_default_image ?? 'imagen-no-disponible.jpg'; $defaultImagePath = $defaultImage === 'imagen-no-disponible.jpg' ? asset('logo/imagen-no-disponible.jpg') : asset('storage/defaults/' . $defaultImage); $mainImagePath = ($record->image && $record->image !== 'imagen-no-disponible.jpg') ? asset('storage/uploads/items/'.$record->image) : $defaultImagePath; @endphp

{{$record->description}}

@php // Rating REAL desde items_rating (pro9 lo inventaba a partir del id). // Sin votos no se muestran estrellas. $rating = $record->rating_count > 0 ? round($record->rating_average, 1) : 0; $percentage = ($rating / 5) * 100; @endphp @if($record->rating_count > 0)
★★★★★
★★★★★
{{ number_format($rating, 1) }}/5 ({{ $record->rating_count }} {{ $record->rating_count == 1 ? 'opinión' : 'opiniones' }})
@endif
{{ $record->currency_type['symbol'] }} {{ number_format( ($record->sale_unit_price * 1.2 ) , 2 ) }} {{ $record->currency_type['symbol'] }} {{ number_format($record->sale_unit_price, 2) }}
@if ($record->category && $record->category->name)

Categoría: {{$record->category->name}}

@endif

Disponible: {{number_format(($record->stock), 0)}} Sin stock

{{ $record->name }}
@foreach($record->attributes as $at) {{$at->description}}: {{$at->value}}
@endforeach
@php $showWhatsapp = ($configurationModel->enable_whatsapp ?? false) && !empty($phoneWhatsapp); @endphp @if($showWhatsapp) @php $waPhoneRaw = preg_replace('/\D+/', '', $phoneWhatsapp); $waPhone = (strlen($waPhoneRaw) == 9 && str_starts_with($waPhoneRaw, '9')) ? '51'.$waPhoneRaw : $waPhoneRaw; $waText = rawurlencode("Buenas, deseo consultar acerca del producto *{$record->description}*, con precio de {$record->currency_type['symbol']}{$record->sale_unit_price}. ¿Podrían brindarme más información?"); $waLink = "https://wa.me/{$waPhone}?text={$waText}"; @endphp Consultar por WhatsApp @endif

{{ $record->description}}

{{ $record->name }}

{{ $record->technical_specifications }}

@endsection