@extends('frontend.layouts.main') @section('title', $header['seo_home']->title) @section('image', asset($header['seo_home']->image_path)) @section('keywords', $header['seo_home']->keyword) @section('description', $header['seo_home']->description) @section('abstract', $header['seo_home']->keyword) @section('idMain', 'page-home') @section('canonical') @endsection @section('code_schema') @include('frontend.components.schema.schema-home') @endsection @section('content')

{{ $header['seo_home']->h1trangchu ?? '' }}

@if(!empty($slides) && $slides->isNotEmpty()) @endif @if(!empty($featuredCategories) && count($featuredCategories) > 0)
@foreach($featuredCategories as $featuredCategory) @endforeach
@endif @php $showFlashSale = false; if (!empty($settingHomePage->start_date) && !empty($settingHomePage->end_date)) { $now = \Carbon\Carbon::now(); $start = \Carbon\Carbon::parse($settingHomePage->start_date); $end = \Carbon\Carbon::parse($settingHomePage->end_date); // Kiểm tra khoảng thời gian hiện tại if ($now->between($start, $end)) { $showFlashSale = true; } } @endphp @if ($saleProducts->isNotEmpty() && $showFlashSale && $settingHomePage)

{{-- --}} {{$settingHomePage->name}}

Thời gian khuyến mãi:
Ngày
Giờ
Phút
Giây
{{-- --}}
@foreach ($saleProducts as $saleProduct) @include('frontend.components.products.item1', ['item' => $saleProduct]) @endforeach
@endif @if ($categories->isNotEmpty())
@foreach ($categories as $category) @if ($category->all_products->isNotEmpty())
@php $childCategories = $category->all_categories ->take(4); @endphp
@if ($childCategories->isNotEmpty()) @else @endif
@foreach ($category->all_products as $productItem)
@include('frontend.components.products.item1', ['item' => $productItem])
@endforeach
{{-- @if ($childCategories->isNotEmpty()) @endif --}}
@if ($category->images->isNotEmpty()) @endif
@endif @endforeach
@endif @if(isset($setting3QuangCao))
@if(isset($setting3QuangCao) && $setting3QuangCao->icon_path) @endif @if(isset($setting3QuangCao) && $setting3QuangCao->icon_path2) @endif @if(isset($setting3QuangCao) && $setting3QuangCao->icon_path3) @endif
@endif
@if(isset($settingCamNhanKH))

{{ $settingCamNhanKH->name }}

@foreach($settingCamNhanKH->childs()->where('active',1)->orderBy('order')->get() as $item)
{!!$item->description!!}
{{$item->name}}
{{$item->name}} {{$item->value}}
@endforeach
@endif
@if(isset($settingCauHoiTG))

{{$settingCauHoiTG->name}}

@foreach($settingCauHoiTG->childs()->where('active',1)->orderBy('order')->get() as $item)
{{$item->name}}
{!!$item->description!!}
@endforeach
@endif
@if (!empty($featuredPost))

{{ $titlePost->name ?? $featuredPost->name2 }}

@if($featuredPost->all_posts->count() > 0) @php $leftPost = $featuredPost->all_posts->first(); @endphp
{{ $leftPost->name2 }}

{{ $leftPost->name2 }}

{!! $leftPost->description !!}
@endif @if($featuredPost->all_posts->count() > 1) @php $rightPosts = $featuredPost->all_posts->slice(1, 4); // từ index 1 lấy 3 bài @endphp
@foreach($rightPosts as $post)

{{ $post->name2 }}

{!! $post->description !!}
@endforeach
@endif
@if(isset($settingQuangCao))
Ảnh banner popup
@endif @endif @endsection @section('js') @endsection @section('css') @endsection