@php use Illuminate\Support\Str; use App\Models\ProductSeo; // Generate SEO-friendly product URL with category path $productSlug = null; $seo = ProductSeo::where('external_id', $item['id']) ->where('external_cod', base64_encode($item['codigo'])) ->first(); if ($seo) { $productSlug = $seo->slug; } $categorySlug = session('current_category_slug'); $subSlug = session('current_sub_slug'); if ($productSlug && $categorySlug && $subSlug) { // Full SEO URL with category path $productUrl = route('website.products.show.category', [ 'categorySlug' => $categorySlug, 'subSlug' => $subSlug, 'productSlug' => $productSlug, ]); } elseif ($productSlug) { // Simple SEO URL $productUrl = route('website.products.show', ['slug' => $productSlug]); } else { // Fallback to old URL (will redirect to SEO URL) $productUrl = route('website.products.show.old', [ 'id' => $item['id'], 'cod' => base64_encode($item['codigo']), ]); } @endphp
product {{--
--}}
@csrf

{{ $item['nombre'] }}

{{ $item['nombre'] }}
PARTNUMBER: {{ $item['part_number'] }}
{{-- CÓDIGO: {{ $item['codigo'] }}
--}} CONDITION: {{ $item['condicion'] }}
@if ($item['es_b2b'] === 'SI') AVAILABLE: @else IN STOCK: @endif @if ($item['existencias'] == 0 && $item['en_transito'] == 0) OUT STOCK @php $out_stock = true; @endphp @else @php $out_stock = false; @endphp @if ($item['en_transito'] != 0 && $item['existencias'] == 0) Stock in transit @else @if ($item['existencias'] >= 300) 300+ @else {{ $item['existencias'] }} @endif PCS @endif @endif
@if ($item['ETA'] <= 0) @if (!empty($out_stock)) Out Stock @else In Stock @endif @else ETA: {{ $item['ETA'] }} DAYS @endif
MOQ: {{ $item['MOQ'] }} UNITS
@if ($item['en_transito'] > 0) IN TRANSIT: {{ $item['en_transito'] }}
@endif @if (session('usuario_autenticado')) PRICE: ${{ $item['precio'] }} @endif

@if ($item['existencias'] > 0 || $item['en_transito'] > 0) @else
Process not available due to lack of stock or in transit
@endif @if (session('usuario_autenticado')) @endif