@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="product">
            <div class="container">
                <div class="product_L">
                    <div class="product-gallery">
                        <div class="product-gallery-featured"> <img src="{{ asset($product->getImage()) }}" alt=""> </div>
                        @if ($product->images->count())
                                <div class="product-gallery-thumbnails">
                                    <div class="thumbnails-list list-unstyled owl-carousel owl-theme">
                                        <li class="item"><img src="{{ asset($product->getImage()) }}" alt=""></li>
                                        @foreach ($product->images as $key=>$image)
                                        <li class="item"><img src="{{ asset($image->getImage()) }}" alt=""></li>
                                        @endforeach
                                    </div>
                                </div>
                        @endif

                    </div>
                </div>
                <div class="product_R product_info">
                    <h1>{{ $product->name }}</h1>
               
                    <button class="btn btn-primary" data-toggle="modal" data-target="#contactus"><span class="ic_main">&#xe041;</span>Liên hệ</button>
                </div>
                <div class="product_content" >
                    <h3>Mô tả sản phẩm</h3>
                    {!! sc_html_render($product->content) !!}
                </div>
                <ul class="products_four">
                    @foreach ($productsToCategory as  $key => $product_rel)
                        <li><a href="{{ $product_rel->getUrl() }}"><img src="{{ asset($product_rel->getThumb()) }}" width="375" height="375" alt=""/>
                                <h2>{{ $product_rel->name }}</h2>
                            </a> </li>
                    @endforeach
                </ul>
            </div>
        </div>
    </div>
@endsection




