@if(count($products) > 0)
@foreach($products as $key => $pro)
@if($pro->subvariants->count() > 0)
@foreach($pro->subvariants as $orivar)
@if($orivar->def == '1')
@php
$var_name_count = count($orivar['main_attr_id']);
$name = array();
$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').'/'.$pro->id.'?'.$name[0]['attr_name'].'='.$var_name[0].'&'.$name[1]['attr_name'].'='.$var_name[1];
}catch(\Exception $e){
$url = url('details').'/'.$pro->id.'?'.$name[0]['attr_name'].'='.$var_name[0];
}
@endphp
@if($orivar->stock == 0)
{{ __('staticwords.Outofstock') }}
@endif
@if($orivar->stock != 0 && $orivar->products->selling_start_at != null
&&
$orivar->products->selling_start_at >= date('Y-m-d'))
{{ __('staticwords.ComingSoon') }}
@endif
@if($pro->featured=="1")
{{ __('staticwords.Hot') }}
@elseif($pro->offer_price != "0")
{{ __('staticwords.Sale') }}
@else
{{ __('staticwords.New') }}
@endif
@php
$reviews = ProductRating::getReview($pro);
@endphp
@if($reviews != 0)
@else
{{'No Rating'}}
@endif
{{substr(strip_tags($pro->des), 0, 40)}}{{strlen(strip_tags(
$pro->des))>40 ? '...' : ""}}
@if($price_login == '0' || Auth::check())
@php
$result = ProductPrice::getprice($pro, $orivar)->getData();
@endphp
@if($result->offerprice == 0)
{{ sprintf("%.2f",$result->mainprice*$conversion_rate) }}
@else
{{ sprintf("%.2f",$result->offerprice*$conversion_rate) }}
{{ sprintf("%.2f",$result->mainprice*$conversion_rate) }}
@endif
@endif
@if($orivar->products->selling_start_at != null &&
$orivar->products->selling_start_at >=
date('Y-m-d'))
@elseif($orivar->stock < 1)
@else
@if($price_login != 1 || Auth::check())
-
@endif
@auth
@if(Auth::user()->wishlist->count()<1) -
@else
@php
$ifinwishlist =
App\Wishlist::where('user_id',Auth::user()->id)->where('pro_id',$orivar->id)->first();
@endphp
@if(!empty($ifinwishlist))
-
@else
-
@endif
@endif
@endauth
-
@endif
@endif
@endforeach
@endif
@endforeach
@else
No Products Found !
@endif
@if(count($products) > 0)
@foreach($products as $key=> $pro)
@if($pro->subvariants->count() > 0)
@foreach($pro->subvariants as $orivar)
@if($orivar->def == '1')
@php
$var_name_count = count($orivar['main_attr_id']);
$name = array();
$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').'/'.$pro->id.'?'.$name[0]['attr_name'].'='.$var_name[0].'&'.$name[1]['attr_name'].'='.$var_name[1];
}catch(\Exception $e)
{
$url = url('details').'/'.$pro->id.'?'.$name[0]['attr_name'].'='.$var_name[0];
}
@endphp
@if($orivar->stock == 0)
{{ __('staticwords.Outofstock') }}
@endif
@if($orivar->stock != 0 && $orivar->products->selling_start_at != null
&&
$orivar->products->selling_start_at >= date('Y-m-d'))
{{ __('staticwords.ComingSoon') }}
@endif
@php
$reviews = ProductRating::getReview($pro);
@endphp
@if($reviews != 0)
@else
{{'No Rating'}}
@endif
@if($price_login == '0' || Auth::check())
@php
$result = ProductPrice::getprice($pro, $orivar)->getData();
@endphp
@if($result->offerprice == 0)
{{ sprintf("%.2f",$result->mainprice*$conversion_rate) }}
@else
{{ sprintf("%.2f",$result->offerprice*$conversion_rate) }}
{{ sprintf("%.2f",$result->mainprice*$conversion_rate) }}
@endif
@endif
{{substr(strip_tags($pro->des), 0, 250)}}{{strlen(strip_tags(
$pro->des))>250 ? '...' : ""}}
@endif
@endforeach
@endif
@endforeach
@else
@endif
{!! $products->appends(Request::except('page'))->links() !!}