@extends('admin.layout.master') @section('title', __('admin.products')) @section('styles') @endsection @section('content')
{{ __('admin.products') }}
{{ __('admin.add_product') }}
@forelse ($products as $product) @empty @endforelse
{{ __('admin.image') }} {{ __('admin.name') }} {{ __('admin.category') }} {{ __('admin.price_per_unit') }} {{ __('admin.min_calculated_price') }} {{ __('admin.sizes') }} {{ __('admin.action') }}
{{ $product->name }} {{ $product->getTranslation('name', app()->getLocale()) }} @if ($product->getTranslation('description', app()->getLocale()))
{{ Str::limit($product->getTranslation('description', app()->getLocale()), 50) }} @endif
@if ($product->category) {{ $product->category->getTranslation('name', app()->getLocale()) }} @else — @endif
@if ($product->price_after_discount && $product->price_after_discount < $product->price_per_unit) {{ number_format($product->price_per_unit, 2) }} {{ number_format($product->price_after_discount, 2) }} @else {{ number_format($product->price_per_unit, 2) }} @endif
@if ($product->has_sizes) @if ($product->minPrice)
@if ($product->minPriceAfterDiscount && $product->minPriceAfterDiscount < $product->minPrice) {{ number_format($product->minPrice, 2) }} {{ number_format($product->minPriceAfterDiscount, 2) }} @else {{ number_format($product->minPrice, 2) }} @endif
@else — @endif @else
@if ($product->price_after_discount && $product->price_after_discount < $product->price) {{ number_format($product->price, 2) }} {{ number_format($product->price_after_discount, 2) }} @else {{ number_format($product->price, 2) }} @endif
@endif
@if ($product->has_sizes) @forelse($product->sizes as $size) @if ($size->size_type === 'meter') {{ $size->length }}×{{ $size->width }}م @endif @empty {{ __('admin.no_sizes') }} @endforelse @else {{ __('admin.no_sizes') }} @endif
@csrf @method('DELETE')
{{ __('admin.no_products_found') }}

{{ __('admin.no_products_description') }}

{{ __('admin.add_first_product') }}
@if ($products->hasPages())
{{ $products->appends(request()->query())->links() }}
@endif
@endsection @section('scripts') @endsection