@foreach($products->take($dashsetting->max_item_pro) as $pro)
@foreach($pro->subvariants as $key=> $sub)
@if($sub->def == 1)
@php
$var_name_count = count($sub['main_attr_id']);
$name = array();
$var_name;
$newarr = array();
for($i = 0; $i<$var_name_count; $i++){ $var_id=$sub['main_attr_id'][$i];
$var_name[$i]=$sub['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(count($pro->subvariants)>0)
@if($sub->variantimages)
@else
@endif
@endif
{{ $pro->name }}
{{ substr(strip_tags($pro->des),0,150)}}{{strlen(strip_tags($pro->des))>150 ? "..." : "" }}
@if($pro->vender_offer_price !=null)
{{ $pro->price_in }} {{ $pro->vender_offer_price+$sub->price }}
@else
{{ $pro->price_in }} {{ $pro->vender_price+$sub->price }}
@endif
@endif
@endforeach
@endforeach