@extends('layouts.app') @section('title', $category->name . ' - ' . __('Categories')) @section('content')
@if($category->image)

{{ $category->name }}

@if($category->description)

{{ $category->description }}

@endif
{{ $products->total() }} {{ __('Products') }} @if($category->children->count() > 0) {{ $category->children->count() }} {{ __('Subcategories') }} @endif
{{ $category->name }}
@else

{{ $category->name }}

@if($category->description)

{{ $category->description }}

@endif
{{ $products->total() }} {{ __('Products') }} @if($category->children->count() > 0) {{ $category->children->count() }} {{ __('Subcategories') }} @endif
@endif
@if($category->children->count() > 0)

{{ __('Subcategories') }}

@foreach($category->children as $subcategory) @endforeach
@endif

{{ __('Products') }}

@if($products->count() > 0)
@foreach($products as $product)
@if($product->images->first()) {{ $product->name }} @else
@endif
{{ $product->name }}
@if($product->description)

{{ Str::limit(strip_tags($product->description), 60) }}

@endif
@php $basePrice = $product->sale_price ?: $product->price; $vatAmount = $basePrice * ($product->tax_rate/100); $customerPrice = $basePrice + $vatAmount; @endphp @if($product->sale_price && $product->sale_price > $product->regular_price) {{ number_format($customerPrice, 2) }} {{ __('SAR') }} {{ number_format($product->price, 2) }} {{ __('SAR') }} @else {{ number_format($product->regular_price, 2) }} {{ __('SAR') }} @endif
@endforeach
{{ $products->links() }}
@else

{{ __('No Products Found') }}

{{ __('This category doesn\'t have any products yet.') }}

@if($category->children->count() > 0)

{{ __('Try browsing the subcategories above.') }}

@endif {{ __('Browse Other Categories') }}
@endif
@if($relatedCategories->count() > 0)

{{ __('Related Categories') }}

@foreach($relatedCategories as $related) @endforeach
@endif
@endsection @push('styles') @endpush @push('scripts') @endpush