@extends('admin_base') @section('title', 'Products') @section('style') @endsection @section('content')
All Products
Low Stock
Critical Stock
Out of Stock
@if($products->isEmpty())

No Products Found

Start by adding your first product to the inventory

Add First Product
@else
@foreach($products as $product) @php $defaultVariant = $product->variations->where('default', true)->first(); $hasOutOfStock = $product->variations->contains(function($variant) { return $variant->is_out_of_stock(); }); $hasCriticalStock = !$hasOutOfStock && $product->variations->contains(function($variant) { return $variant->is_critical_stock(); }); $hasLowStock = !$hasOutOfStock && !$hasCriticalStock && $product->variations->contains(function($variant) { return $variant->is_low_stock(); }); @endphp @endforeach
Product Tags Rating Variants Actions
@if($product->primary_image) {{ $product->title }} @else
@endif
{{ $product->title }} @if($hasOutOfStock) Out of Stock @elseif($hasCriticalStock) Critical Stock @elseif($hasLowStock) Low Stock @endif
{{ $product->category->parent ? $product->category->parent->name . ' > ' . $product->category->name : $product->category->name }}
@if($product->tags) @foreach($product->tags as $tag) {{ $tag }} @endforeach @endif @if($product->ratings_count > 0)
@for($i = 1; $i <= 5; $i++) @if($i <= round($product->average_rating)) @else @endif @endfor ({{ $product->ratings_count }})
@else No ratings yet @endif
@if($defaultVariant)
{{ $defaultVariant->unit_type }}: {{ $defaultVariant->unit_value }}
৳{{ number_format($defaultVariant->sale_price) }} @if($defaultVariant->regular_price > $defaultVariant->sale_price) ৳{{ number_format($defaultVariant->regular_price) }} @endif @php $additionalVariants = $product->variations->where('default', false)->count(); @endphp @if($additionalVariants > 0) +{{ $additionalVariants }} @endif
@endif
@if($products->hasPages())
{{ $products->links('pagination::bootstrap-4') }}
@else
@endif @endif @endsection @section('script') @endsection