@extends('frontend.layouts.app') @section('meta_title'){{ $shop->meta_title }}@stop @section('meta_description'){{ $shop->meta_description }}@stop @section('meta') @endsection @section('content') @php $total = 0; $rating = 0; foreach ($shop->user->products as $key => $seller_product) { $total += $seller_product->reviews->count(); $rating += $seller_product->reviews->sum('rating'); } @endphp {{ $shop->name }} @if ($shop->user->seller->verification_status == 1) @else @endif @if ($total > 0) {{ renderStarRating($rating/$total) }} @else {{ renderStarRating(0) }} @endif {{ $shop->address }} {{ translate('Store Home')}} {{ translate('Top Selling')}} {{ translate('All Products')}} @if ($shop->facebook != null) @endif @if ($shop->twitter != null) @endif @if ($shop->google != null) @endif @if ($shop->youtube != null) @endif @if (!isset($type)) @if ($shop->sliders != null) @foreach (explode(',',$shop->sliders) as $key => $slide) @endforeach @endif {{ translate('Featured Products')}} @foreach ($shop->user->products->where('published', 1)->where('seller_featured', 1) as $key => $product) @include('frontend.partials.product_box_1',['product' => $product]) @endforeach @endif @if (!isset($type)) {{ translate('New Arrival Products')}} @elseif ($type == 'top_selling') {{ translate('Top Selling')}} @elseif ($type == 'all_products') {{ translate('All Products')}} @endif @php if (!isset($type)){ $products = \App\Product::where('user_id', $shop->user->id)->where('published', 1)->orderBy('created_at', 'desc')->paginate(24); } elseif ($type == 'top_selling'){ $products = \App\Product::where('user_id', $shop->user->id)->where('published', 1)->orderBy('num_of_sale', 'desc')->paginate(24); } elseif ($type == 'all_products'){ $products = \App\Product::where('user_id', $shop->user->id)->where('published', 1)->paginate(24); } @endphp @foreach ($products as $key => $product) @include('frontend.partials.product_box_1',['product' => $product]) @endforeach {{ $products->links() }} @endsection