RUT: 77.943.847-3
Comercialización de Artículos Publicitarios
Tel.: 974791522 | Mail: ventas@mar-k.cl
| Imagen | Descripción | Cantidad | Código | Unitario | Valor |
|---|---|---|---|---|---|
|
@php
$imagenBase64 = null;
// Intentar con imágenes del producto primero
if($ventaProducto->producto && $ventaProducto->producto->images) {
$images = is_string($ventaProducto->producto->images) ? json_decode($ventaProducto->producto->images, true) : $ventaProducto->producto->images;
$firstImage = is_array($images) && !empty($images) ? $images[0] : null;
if($firstImage) {
// Verificar si es una URL remota
if(filter_var($firstImage, FILTER_VALIDATE_URL)) {
try {
$imagenData = @file_get_contents($firstImage);
if($imagenData !== false) {
$imagenBase64Data = base64_encode($imagenData);
// Detectar tipo MIME desde la URL o contenido
$extension = pathinfo(parse_url($firstImage, PHP_URL_PATH), PATHINFO_EXTENSION);
$mimeType = $extension === 'png' ? 'png' : ($extension === 'webp' ? 'webp' : 'jpeg');
$imagenBase64 = "data:image/$mimeType;base64," . $imagenBase64Data;
}
} catch (\Exception $e) {
// Silenciosamente ignorar errores de descarga
}
} else {
// Es una ruta local
$rutaImagen = storage_path('app/public/' . $firstImage);
if(file_exists($rutaImagen)) {
$imagenData = base64_encode(file_get_contents($rutaImagen));
$extension = strtolower(pathinfo($rutaImagen, PATHINFO_EXTENSION));
$mimeType = $extension === 'png' ? 'png' : ($extension === 'webp' ? 'webp' : 'jpeg');
$imagenBase64 = "data:image/$mimeType;base64," . $imagenData;
}
}
}
}
// Si no hay imagen del producto, intentar con maqueta_imagen
if(!$imagenBase64 && $ventaProducto->maqueta_imagen) {
$rutaImagen = storage_path('app/public/' . $ventaProducto->maqueta_imagen);
if(file_exists($rutaImagen)) {
$imagenData = base64_encode(file_get_contents($rutaImagen));
$extension = strtolower(pathinfo($rutaImagen, PATHINFO_EXTENSION));
$mimeType = $extension === 'png' ? 'png' : ($extension === 'webp' ? 'webp' : 'jpeg');
$imagenBase64 = "data:image/$mimeType;base64," . $imagenData;
}
}
@endphp
@if($imagenBase64)
Sin imagen
@endif
|
{{ $ventaProducto->producto->name ?? 'Producto no encontrado' }}
@if($ventaProducto->tiene_aplicacion && $ventaProducto->tipo_aplicacion && $ventaProducto->tipo_aplicacion !== 'Sin Aplicación')
Aplicación: {{ $ventaProducto->tipo_aplicacion }}
@endif
@if($ventaProducto->tiene_aplicacion && $ventaProducto->cantidad_logos && $ventaProducto->cantidad_logos > 0)
Número de Logos: {{ $ventaProducto->cantidad_logos }}
@endif
@if($ventaProducto->tiene_aplicacion && $ventaProducto->cantidad_colores && $ventaProducto->cantidad_colores > 0)
Número de Colores Logo: {{ $ventaProducto->getCantidadColoresLabel() }}
@endif
@if($ventaProducto->tiene_aplicacion && $ventaProducto->tinta_solicitada)
@php
$tintaLabel = match($ventaProducto->tinta_solicitada) {
'negra' => 'Negra',
'azul' => 'Azul',
default => ucfirst($ventaProducto->tinta_solicitada),
};
@endphp
Color de Tinta: {{ $tintaLabel }}
@endif
|
{{ $cantidad }}
|
{{ $codigo }}
|
@if($ventaProducto->isAgotado())
—
@else
${{ number_format($valorUnitarioConAgencia, 0, ',', '.') }}
@endif
|
@if($ventaProducto->isAgotado())
Producto Agotado
@else
${{ number_format($valorTotal, 0, ',', '.') }}
@endif
|
|
@if($cuenta_bancaria)
Datos Bancarios
{!! $cuenta_bancaria !!}
|
|
Tenga Presente
No hay términos y condiciones configurados.
' !!}