@extends('layouts.front-end.app') @section('title',\App\CPU\translate('Welcome To').' '.$web_config['name']->value) @push('css_or_js') @endpush @section('content') @php($decimal_point_settings = \App\CPU\Helpers::get_business_settings('decimal_point_settings'))
@include('web-views.partials._home-top-slider')
{{--flash deal--}} @php($flash_deals=\App\Model\FlashDeal::with(['products'=>function($query){ $query->with('product')->whereHas('product',function($q){ $q->active(); }); }])->where(['status'=>1])->where(['deal_type'=>'flash_deal'])->whereDate('start_date','<=',date('Y-m-d'))->whereDate('end_date','>=',date('Y-m-d'))->first()) @if (isset($flash_deals))
@if (count($flash_deals->products)>0) {{ \App\CPU\translate('view_all')}} @endif
{{ \App\CPU\translate('flash deal')}}
{{ \App\CPU\translate('day')}} : {{ \App\CPU\translate('hrs')}} : {{ \App\CPU\translate('min')}} : {{ \App\CPU\translate('sec')}}
@endif {{--brands--}} @if ($featured_products->count() > 0 )
{{ \App\CPU\translate('featured_products')}}
@endif {{--featured deal--}} @php($featured_deals=\App\Model\FlashDeal::with(['products'=>function($query_one){ $query_one->with('product.reviews')->whereHas('product',function($query_two){ $query_two->active(); }); }]) ->whereDate('start_date', '<=', date('Y-m-d'))->whereDate('end_date', '>=', date('Y-m-d')) ->where(['status'=>1])->where(['deal_type'=>'feature_deal']) ->first()) @if(isset($featured_deals)) @endif {{--deal of the day--}}
{{-- Deal of the day/Recommended Product --}}
@if(isset($deal_of_the_day) && isset($deal_of_the_day->product))

{{ \App\CPU\translate('deal_of_the_day') }}

@php($overallRating = \App\CPU\ProductManager::get_overall_rating($deal_of_the_day->product['reviews']))
{{\Illuminate\Support\Str::limit($deal_of_the_day->product['name'],30)}}
@for($inc=0;$inc<5;$inc++) @if($inc<$overallRating[0]) @else @endif @endfor
@if($deal_of_the_day->product->discount > 0) {{\App\CPU\Helpers::currency_converter($deal_of_the_day->product->unit_price)}} @endif {{\App\CPU\Helpers::currency_converter( $deal_of_the_day->product->unit_price-(\App\CPU\Helpers::get_product_discount($deal_of_the_day->product,$deal_of_the_day->product->unit_price)) )}}
@else @php($product=\App\Model\Product::active()->inRandomOrder()->first()) @if(isset($product))

{{ \App\CPU\translate('recommended_product') }}

@php($overallRating = \App\CPU\ProductManager::get_overall_rating($product['reviews']))
{{\Illuminate\Support\Str::limit($product['name'],40)}}
@for($inc=0;$inc<5;$inc++) @if($inc<$overallRating[0]) @else @endif @endfor
@if($product->discount > 0) {{\App\CPU\Helpers::currency_converter($product->unit_price)}} @endif {{\App\CPU\Helpers::currency_converter( $product->unit_price-(\App\CPU\Helpers::get_product_discount($product,$product->unit_price)) )}}
@endif @endif
{{-- Latest products --}}
{{ \App\CPU\translate('latest_products')}}
@foreach($latest_products as $product)
@include('web-views.partials._single-product',['product'=>$product,'decimal_point_settings'=>$decimal_point_settings])
@endforeach
@php($main_section_banner = \App\Model\Banner::where('banner_type','Main Section Banner')->where('published',1)->orderBy('id','desc')->latest()->first()) @if (isset($main_section_banner))
@endif @php($business_mode=\App\CPU\Helpers::get_business_settings('business_mode')) {{--categries--}}

{{ \App\CPU\translate('ARRIVALS')}}

{{ \App\CPU\translate('best sellings')}}
@foreach($bestSellProduct as $key=>$bestSell) @if($bestSell->product && $key<3)
@if($bestSell->product->discount > 0)
@if ($bestSell->product->discount_type == 'percent') {{round($bestSell->product->discount)}}% @elseif($bestSell->product->discount_type =='flat') {{\App\CPU\Helpers::currency_converter($bestSell->product->discount)}} @endif {{\App\CPU\translate('off')}}
@endif
{{\Illuminate\Support\Str::limit($bestSell->product['name'],100)}}
@php($bestSell_overallRating = \App\CPU\ProductManager::get_overall_rating($bestSell->product['reviews']))
@for($inc=0;$inc<5;$inc++) @if($inc<$bestSell_overallRating[0]) @else @endif @endfor
@if($bestSell->product->discount > 0) {{\App\CPU\Helpers::currency_converter($bestSell->product->unit_price)}} @endif
{{\App\CPU\Helpers::currency_converter( $bestSell->product->unit_price-(\App\CPU\Helpers::get_product_discount($bestSell->product,$bestSell->product->unit_price)) )}}
@endif @endforeach
{{ \App\CPU\translate('top rated')}}
@foreach($topRated as $key=>$top) @if($top->product && $key<3)
@if($top->product->discount > 0)
@if ($top->product->discount_type == 'percent') {{round($top->product->discount)}}% @elseif($top->product->discount_type =='flat') {{\App\CPU\Helpers::currency_converter($top->product->discount)}} @endif {{\App\CPU\translate('off')}}
@endif
{{\Illuminate\Support\Str::limit($top->product['name'],100)}}
@php($top_overallRating = \App\CPU\ProductManager::get_overall_rating($top->product['reviews']))
@for($inc=0;$inc<5;$inc++) @if($inc<$top_overallRating[0]) @else @endif @endfor
@if($top->product->discount > 0) {{\App\CPU\Helpers::currency_converter($top->product->unit_price)}} @endif
{{\App\CPU\Helpers::currency_converter( $top->product->unit_price-(\App\CPU\Helpers::get_product_discount($top->product,$top->product->unit_price)) )}}
@endif @endforeach
{{-- Banner --}}
@foreach(\App\Model\Banner::where('banner_type','Footer Banner')->where('published',1)->orderBy('id','desc')->take(2)->get() as $banner) @endforeach
{{-- Categorized product --}} @foreach($home_categories as $category)
{{Str::limit($category['name'],18)}}
@foreach($category['products'] as $key=>$product) @if(!empty($product)) @if ($key<4)
@include('web-views.partials._category-single-product',['product'=>$product,'decimal_point_settings'=>$decimal_point_settings])
@endif @endif @endforeach
@endforeach {{--delivery type --}}

{{ \App\CPU\translate('Fast Delivery all accross the country')}}

{{ \App\CPU\translate('Safe Payment')}}

{{ \App\CPU\translate('7 Days Return Policy')}}

{{ \App\CPU\translate('100% Authentic Products')}}

@endsection @push('script') {{-- Owl Carousel --}} @endpush