@php require_once base_path().'/app/Http/Controllers/price.php'; $price_login = App\Genral::first()->login; $enable_cat_widget = App\Widgetsetting::where('name','category')->first(); $price_array = array(); @endphp @if(!empty($home_slider)) @if($enable_cat_widget->home=='1')
{{ __('staticwords.Categories') }}
    @php $price_array = array(); if($genrals_settings->vendor_enable == 1){ $pirmarycategories = App\Category:: join('products', function ($join) { $join->on('products.category_id', '=', 'categories.id')->where('products.status','1'); }) ->leftjoin('users', function ($join) { $join->on('products.vender_id', '=', 'users.id')->where('users.status','1'); }) ->orderBy('position','ASC')->select('categories.*')->where('categories.status','=','1')->get(); }else{ $pirmarycategories = App\Category:: join('products', function ($join) { $join->on('products.category_id', '=', 'categories.id')->where('products.status','1'); }) ->leftjoin('users', function ($join) { $join->on('products.vender_id', '=', 'users.id')->where('users.status','1')->where('users.role_id','=','a'); }) ->orderBy('position','ASC')->select('categories.*')->where('categories.status','=','1')->get(); } @endphp
      @foreach($pirmarycategories->unique() as $item)
    • {{ $item['title'] }}
      @if($item->subcategory->count() > 0)
      @endif
        @foreach($item->subcategory as $subcategory)
        {{ $subcategory['title'] }}
        @if($subcategory->childcategory->count() > 0)
        @endif
        • @foreach($subcategory->childcategory as $childcategory) {{ $childcategory['title'] }} @endforeach
        @endforeach
    • @endforeach
@endif @endif @php $enable_hotdeal = App\Widgetsetting::where('name','hotdeals')->first(); $date = date('Y-m-d h:i:s'); if($genrals_settings->vendor_enable != 1){ $hotdeals = App\Hotdeal::join('products','products.id','=','hotdeals.pro_id')->join('users','users.id','=','products.vender_id')->where('users.status','1')->where('products.status','=','1')->where('hotdeals.status','=','1')->where('users.role_id','!=','v')->get(); }else{ $hotdeals = App\Hotdeal::join('products','products.id','=','hotdeals.pro_id')->join('users','users.id','=','products.vender_id')->where('users.status','1')->where('products.status','=','1')->where('hotdeals.status','=','1')->get(); } @endphp @if(isset($enable_hotdeal) && $enable_hotdeal->home == "1")

{{ __('staticwords.Hotdeals') }}

@foreach($hotdeals as $value) @if(isset($value->pro)) @foreach($value->pro->subvariants as $key=> $orivar) @if($orivar->def ==1) @if($price_login == 0 || Auth::check()) @php $convert_price = 0; $show_price = 0; $commision_setting = App\CommissionSetting::first(); if($commision_setting->type == "flat"){ $commission_amount = $commision_setting->rate; if($commision_setting->p_type == 'f'){ $totalprice = $value->pro->vender_price+$orivar->price+$commission_amount; $totalsaleprice = $value->pro->vender_offer_price + $orivar->price + $commission_amount; if($value->pro->vender_offer_price == 0){ $totalprice; array_push($price_array, $totalprice); }else{ $totalsaleprice; $convert_price = $totalsaleprice==''?$totalprice:$totalsaleprice; $show_price = $totalprice; array_push($price_array, $totalsaleprice); } }else{ $totalprice = ($value->pro->vender_price+$orivar->price)*$commission_amount; $totalsaleprice = ($value->pro->vender_offer_price+$orivar->price)*$commission_amount; $buyerprice = ($value->pro->vender_price+$orivar->price)+($totalprice/100); $buyersaleprice = ($value->pro->vender_offer_price+$orivar->price)+($totalsaleprice/100); if($value->pro->vender_offer_price ==0){ $bprice = round($buyerprice,2); array_push($price_array, $bprice); }else{ $bsprice = round($buyersaleprice,2); $convert_price = $buyersaleprice==''?$buyerprice:$buyersaleprice; $show_price = $buyerprice; array_push($price_array, $bsprice); } } }else{ $comm = App\Commission::where('category_id',$value->pro->category_id)->first(); if(isset($comm)){ if($comm->type=='f'){ $price = $value->pro->vender_price + $comm->rate+$orivar->price; $offer = $value->pro->vender_offer_price + $comm->rate+$orivar->price; $convert_price = $offer==''?$price:$offer; $show_price = $price; if($value->pro->vender_offer_price == 0){ array_push($price_array, $price); }else{ array_push($price_array, $offer); } } else{ $commission_amount = $comm->rate; $totalprice = ($value->pro->vender_price+$orivar->price)*$commission_amount; $totalsaleprice = ($value->pro->vender_offer_price+$orivar->price)*$commission_amount; $buyerprice = ($value->pro->vender_price+$orivar->price)+($totalprice/100); $buyersaleprice = ($value->pro->vender_offer_price+$orivar->price)+($totalsaleprice/100); if($value->pro->vender_offer_price ==0){ $bprice = round($buyerprice,2); array_push($price_array, $bprice); }else{ $bsprice = round($buyersaleprice,2); $convert_price = $buyersaleprice==''?$buyerprice:$buyersaleprice; $show_price = round($buyerprice,2); array_push($price_array, $bsprice); } } }else{ $commission_amount = 0; $totalprice = ($value->pro->vender_price+$orivar->price)*$commission_amount; $totalsaleprice = ($value->pro->vender_offer_price+$orivar->price)*$commission_amount; $buyerprice = ($value->pro->vender_price+$orivar->price)+($totalprice/100); $buyersaleprice = ($value->pro->vender_offer_price+$orivar->price)+($totalsaleprice/100); if($value->pro->vender_offer_price ==0){ $bprice = round($buyerprice,2); array_push($price_array, $bprice); }else{ $bsprice = round($buyersaleprice,2); $convert_price = $buyersaleprice==''?$buyerprice:$buyersaleprice; $show_price = round($buyerprice,2); array_push($price_array, $bsprice); } } } @endphp @endif @php $var_name_count = count($orivar['main_attr_id']); $name; $var_name; $newarr = array(); for($i = 0; $i<$var_name_count; $i++){ $var_id=$orivar['main_attr_id'][$i]; $var_name[$i]=$orivar['main_attr_value'][$var_id]; $name[$i]=App\ProductAttributes::where('id',$var_id)-> first(); } try{ $url = url('details').'/'.$value->pro->id.'?'.$name[0]['attr_name'].'='.$var_name[0].'&'.$name[1]['attr_name'].'='.$var_name[1]; }catch(\Exception $e) { $url = url('details').'/'.$value->pro->id.'?'.$name[0]['attr_name'].'='.$var_name[0]; } @endphp @if($date <= $value->end)
@if(count($value->pro->subvariants)>0) @if(isset($orivar->variantimages['image2'])) {{$value->name}} @endif @else No Image @endif
@if($value->pro->vender_offer_price != 0 || $value->pro->vender_offer_price != null) @php $getdisprice = $value->pro->vender_price - $value->pro->vender_offer_price; $gotdis = $getdisprice/$value->pro->vender_price; $offamount = $gotdis*100; @endphp
0%
off
@endif

{{$value->pro->name}}