@forelse ($products as $product)
@if (!$product->draft)
{{ $product->display_name }}
{{ $product->model }}
@php
$instance = $product->getBestPricedInstance();
$priceText = '$' . $product->price . ' MXN';
if ($instance && isset($instance->price)) {
if ($instance->offert && isset($instance->offert->discount_price)) {
$oldPrice = number_format($instance->price, 2, '.', ',');
$price = number_format($instance->offert->discount_price, 2, '.', ',');
$priceText =
'$' .
$oldPrice .
' MXN $' .
$price .
' MXN';
} else {
$price = number_format($instance->price, 2, '.', ',');
$priceText = '$' . $price . ' MXN';
}
}
@endphp
{!! $priceText !!}
@endif
@empty
No hay productos disponibles
@endforelse