{{-- @if ($product->isOutOfStock()) ({{ __('Out of stock') }}) @else @if (!$productVariation) ({{ __('Not available') }}) @else @if ($productVariation->isOutOfStock()) ({{ __('Out of stock') }}) @elseif (!$productVariation->with_storehouse_management || $productVariation->quantity < 1) ({!! BaseHelper::clean($productVariation->stock_status_html) !!}) @elseif ($productVariation->quantity) @if (EcommerceHelper::showNumberOfProductsInProductSingle()) @if ($productVariation->quantity != 1) ({{ __(':number products available', ['number' => $productVariation->quantity]) }}) @else ({{ __(':number product available', ['number' => $productVariation->quantity]) }}) @endif @else ({{ __('In stock') }}) @endif @endif @endif @endif --}} @php $hasComingSoon = false; if ($product->isOutOfStock()) { $hasComingSoon = \App\Models\MstPurchaseOrder::whereHas('products', function($query) use ($product) { $query->where('product_id', $product->id); })->whereIn('delivery_status', ['pending', 'on_the_way'])->exists(); } @endphp @if ($product->isOutOfStock()) @if ($hasComingSoon) {{ __('Coming Soon') }} @else {{ __('Out of stock') }} @endif @else @if (!$product) {{ __('Not available') }} @else @if ($product->isOutOfStock()) {{ __('Out of stock') }} @elseif (!$product->with_storehouse_management || $product->getCurrentStock() < 1) {!! BaseHelper::clean($product->stock_status_html) !!} @elseif ($product->getCurrentStock() > 0) @if (EcommerceHelper::showNumberOfProductsInProductSingle()) {{-- @if ($product->getCurrentStock() != 1) {{ __(':number available', ['number' => $product->getCurrentStock()]) }} @else {{ __(':number available', ['number' => $product->getCurrentStock()]) }} @endif --}} @php $stock = $product->getCurrentStock(); if ($stock >= 1 && $stock <= 7) { $displayStock = $stock; } elseif ($stock == 8) { $displayStock = 8; } elseif ($stock > 8) { $displayStock = '8+'; } @endphp {{ __(':number available', ['number' => $displayStock]) }} @else {{ __('In stock') }} @endif @endif @endif @endif