@props(['product', 'bodegaCode' => null, 'imageHoverSwap' => true]) @php $inventoryEnabled = \App\Models\Setting::getByKey('inventory_enabled'); $showInventory = ($inventoryEnabled === '1' || $inventoryEnabled === 1 || $inventoryEnabled === true); $vacationInfo = \App\Models\Setting::getVacationModeInfo(); $isVacationMode = $vacationInfo['active']; $formattedVacationDate = $vacationInfo['formatted_date'] ?? 'pronto'; $primaryImage = $product->images->first(); $secondaryImage = $product->images->skip(1)->first(); @endphp
{{$product->sku}}
@endif @auth @php $isManaged = $product->isInventoryManaged(); $preferredVariationItemId = $product->preferredVariationItemIdForBodega($bodegaCode); // Use orderable stock (available - safety) for client-facing display $orderableStock = $product->getOrderableStockForBodega($bodegaCode, $preferredVariationItemId); @endphp @if($showInventory && $isManaged) @if($orderableStock <= 0)Producto no disponible para tu ubicación
@elseInventario: {{ $orderableStock }}
@endif @endif @else @php $isManaged = $product->isInventoryManaged(); $preferredVariationItemId = $product->preferredVariationItemIdForBodega('MDTAT'); // Use orderable stock (available - safety) for client-facing display $orderableStock = $product->getOrderableStockForBodega('MDTAT', $preferredVariationItemId); @endphp @if($showInventory && $isManaged) @if($orderableStock <= 0)Producto no disponible para tu ubicación
@elseInventario: {{ $orderableStock }}
@endif @endif @endauth(Und. x) ${{ currency($product->final_price['perItemPrice']) }}
@endif