{{-- E-commerce Products Component (Integration with existing widget) --}} @php $displayType = $component['content']['display_type'] ?? 'grid'; $productsPerRow = $component['content']['products_per_row'] ?? 4; $showPrice = $component['content']['show_price'] ?? true; $showAddToCart = $component['content']['show_add_to_cart'] ?? true; $categoryFilter = $component['content']['category_filter'] ?? null; $limit = $component['content']['limit'] ?? 8; // Get products from e-commerce module if available $products = []; if (class_exists('\App\Models\Product')) { $query = \App\Models\Product::where('status', 'active'); if ($categoryFilter) { $query->where('category_id', $categoryFilter); } $products = $query->limit($limit)->get(); } @endphp @if(count($products) > 0)
@foreach($products as $product)
@if($product->image)
{{ $product->name }} @if($product->is_featured) Featured @endif @if($product->discount > 0) -{{ $product->discount }}% @endif
@endif
{{ $product->name }}
@if($product->short_description)

{{ Str::limit($product->short_description, 80) }}

@endif @if($showPrice)
@if($product->discount > 0) ${{ number_format($product->regular_price, 2) }} ${{ number_format($product->sale_price, 2) }} @else ${{ number_format($product->price, 2) }} @endif
@endif @if($showAddToCart) @else View Details @endif
@endforeach
@else {{-- Empty State with helpful actions --}}

No Products Yet

Get started by adding your first products to showcase them here.

@if(auth()->check()) {{-- For logged-in users: show direct action buttons --}} Add Product Browse E-Commerce Widgets @else {{-- For public visitors: show placeholder products --}} @endif
{{-- Optional: Show sample product cards as placeholders --}} @if(!auth()->check())
@for($i = 1; $i <= 3; $i++)
@endfor
@endif
@endif