@php
    $modelCategory = (new \App\Models\ShopCategory);
    $categoriesTop = $modelCategory->getCategoriesTop();
@endphp
@extends('templates.'.sc_store('template').'.shop_layout')

@section('main')
    <div class="index_middle">
        <div class="banner_inside" style="background-image:url({{ asset('templates/'.sc_store('template').'/images/page_product.jpg')}})">
            <div class="container">
                <div class="inside_title">
                    <h1>Sản phẩm</h1>
                    <ol class="breadcrumb">
                        <li><a href="{{ route('home') }}"><span class="icon ic_lankim">&#xe009;</span>Trang chủ</a></li>
                        <li class="active">{{ $title }}</li>
                    </ol>
                </div>
            </div>
        </div>
        <div class="container">
            <div class="menu_cate">
                <p class="nav_center_T"><a data-toggle="collapse" href="#nav_center">Choose Story<span class="ic_main ar_down">&#xe036;</span></a></p>
                <ul class="nav navbar-nav nav_center" id="nav_center">
                    @foreach ($categoriesTop as $productCategory)
                        <li><a href="{{ $productCategory->getUrl() }}">  {{ $productCategory->name }} </a></li>
                    @endforeach
                </ul>
            </div>

            <h3 class="title_child">{{ $title }}</h3>
            @if (count($products) ==0)
                {{ trans('front.empty_product') }}
            @else
            <ul class="products">
                @foreach ($products as  $key => $product)
                    <li><a href="{{ $product->getUrl() }}"><img src="{{ asset($product->getThumb()) }}" width="375" height="375" alt=""/>
                            <h2>{{ $product->name }}</h2>
                        </a>
                    </li>
                @endforeach
            </ul>
            @endif
            <div class="paginations">
                <ul class="pagination">
                    {{ $products->appends(request()->except(['page','_token']))->links() }}
                </ul>
            </div>
        </div>
    </div>

@endsection


