@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'); } $featuredProduct = \App\Product::where('seller_id', $shop->user->id)->where('published', 1)->where('featured', 1)->orderByRaw('RAND()')->get(); @endphp
{{ $shop->name }}

{{ $shop->user->name ?? $shop->name }} @if ($shop->user->seller->verification_status == 1) @else @endif

@if ($total > 0) {{ renderStarRating($rating/$total) }} @else {{ renderStarRating(0) }} @endif
{{--
{{ $shop->address }}
--}}
@include('frontend.seller.seller-shop-banner')
@if (!isset($type))

{{ translate('Featured Products')}}

@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('seller_id', $shop->user->id)->where('published', 1)->orderBy('created_at', 'desc')->paginate(24); } elseif ($type == 'top_selling'){ $products = \App\Product::where('seller_id', $shop->user->id)->where('published', 1)->orderBy('num_of_sale', 'desc')->paginate(24); } elseif ($type == 'all_products'){ $products = \App\Product::where('seller_id', $shop->user->id)->where('published', 1)->orderByRaw('RAND()')->paginate(24); } @endphp @foreach ($products as $key => $product)
@if(!empty($product->discount)) {{$product->discount}}% off @endif {{  __($product->name) }}
@if (\App\Addon::where('unique_identifier', 'club_point')->first() != null && \App\Addon::where('unique_identifier', 'club_point')->first()->activated)
{{ translate('Club Point') }}: {{ $product->earn_point }}
@endif

{{ __($product->name) }}

@if(home_price($product->id) != home_discounted_price($product->id)) {{ home_base_price($product->id) }} {{ home_discounted_base_price($product->id) }} @else {{ home_discounted_base_price($product->id) }} @endif
{{ renderStarRating($product->rating) }}
@endforeach
@endsection