@extends('layouts.admin')
@section('title', __('admin.shipping'))
@section('breadcrumb', __('admin.group.settings'))
@section('content')
@php($baseCode = \App\Support\Shop::baseCurrency()?->code ?? 'IQD')
@php($languages = \App\Support\Shop::activeLanguages())
@include('admin.partials.grid-toolbar', [
'action' => route('admin.shipping.index'),
'search' => $search,
'placeholder' => __('admin.search_zone'),
'count' => $zones->total(),
'addTarget' => 'create-zone',
'addLabel' => __('admin.add_zone'),
'filters' => [
[
'name' => 'status',
'label' => __('admin.status'),
'value' => $status,
'options' => [
'all' => __('admin.all'),
'active' => __('admin.active'),
'inactive' => __('admin.inactive'),
'free' => __('admin.free_shipping'),
],
],
],
])
{{ __('admin.shipping_help', ['base' => $baseCode]) }}
@forelse ($zones as $z)
@php($modalId = 'edit-zone-'.$z->id)
@php($zoneName = $z->tr('name'))
@php($cities = $z->cities ?: [])
{{ mb_strtoupper(mb_substr($zoneName, 0, 2)) }}
{{ $zoneName }}
{{ __('admin.cities_count', ['count' => count($cities)]) }}
@if ($z->free_over !== null)
{{ __('admin.free_over') }} {{ number_format($z->free_over) }}
@endif
{{ $z->is_active ? __('admin.active') : __('admin.inactive') }}
{{ __('admin.cost') }}
{{ $z->cost > 0 ? money($z->cost) : __('admin.free_shipping') }}
{{ __('admin.free_over') }}
{{ $z->free_over !== null ? money($z->free_over) : '—' }}
{{ __('admin.sort_order') }}
{{ $z->sort_order }}
@if (count($cities))
@foreach (array_slice($cities, 0, 4) as $city)
{{ $city }}
@endforeach
@if (count($cities) > 4)
+{{ count($cities) - 4 }}
@endif
@endif
@empty
{{ __('admin.no_results') }}
{{ __('admin.no_results_help') }}
@endforelse
@include('admin.partials.pagination', ['paginator' => $zones])
@endsection