@extends('admin::layouts.master') @section('content')
@lang('partials.list')
@lang('partials.create')
@if(isset($products) && count($products)) @forelse($products as $product) @php // Since $products might be from DTO, let's check the structure $productId = $product['id'] ?? $product->id ?? null; // Load documents for this product if not already loaded // If using DTO, you might need to eager load documents differently @endphp @empty @endforelse
@lang('partials.s_n') @lang('partials.sku') @lang('partials.title') @lang('sidebar.category') @lang('partials.is_featured') @lang('partials.price') @lang('messages.discount') @lang('partials.tags') @lang('sidebar.brands') @lang('partials.quantity') @lang('partials.image') @lang('partials.status') Associated Document @lang('sidebar.attributes') @lang('partials.action')
{{ $loop->iteration }} {{ $product['sku'] ?? 'N/A' }} {{ $product['title'] ?? '' }} {{ isset($product['categories']) ? implode(', ', array_column($product['categories'], 'title')) : 'N/A' }} {{ !empty($product['is_featured']) ? 'Yes' : 'No' }} {{ $product['price'] ?? '' }} {{ $product['discount'] ?? '' }} @if(isset($product['tags']) && is_array($product['tags'])) {{ implode(', ', array_column($product['tags'], 'title')) }} @else N/A @endif {{ $product['brand']['title'] ?? 'N/A' }} {{ $product['stock'] ?? '' }} {{ $product['title'] ?? '' }} {{ ucfirst($product['status'] ?? '') }} @if($productId) @php // Get documents for this product $documents = \Modules\Documents\Models\Documents::where('associated_product_id', $productId)->get(); @endphp @if($documents->count() > 0)
@foreach($documents as $document)
{{ Str::limit($document->title, 15) }}
{{ $document->type }} | {{ $document->product_page_location }}
@endforeach
@else No Documents
Add Document @endif @else N/A @endif
@if(!empty($product['attributes']))
    @foreach($product['attributes'] as $attributeValue) @php $attr = $attributeValue['attribute'] ?? null; $column = $attr['type'] ?? 'text'; $value = $attributeValue['value'] ?? null; @endphp @if($attr && $value)
  • {{ $attr['name'] ?? $attr['label'] ?? '' }}: {{ $value }}
  • @endif @endforeach
@endif
@csrf @method('DELETE')
No products found!
@else
No products found!
@endif
@endsection