@extends("front/layout.master") @section('title',__('staticwords.ShoppingCart').' | ') @section("body") @php $pro = Session('pro_qty'); $stock = session('stock'); $value = Session::get('cart'); if (!empty($auth)) { $cart_table = App\Cart::where('user_id', $auth->id) ->get(); $count = App\Cart::where('user_id', $auth->id) ->count(); } else { if (isset($value)) { $count = count($value); } else { $count = 0; } } if(Auth::check()){ $usercart = $cart_table; }else{ $usercart = Session::get('cart'); } @endphp
@if(count($usercart)>0)
@if(Session::has('validcurrency'))
{{ __('staticwords.Oscur') }} {{ Session::get('currency')['id'] }} {{ __('staticwords.CerrorMsg') }} !
@endif

{{ __('staticwords.Products') }} {{ __('staticwords.inyourcart') }}

@if(!empty($auth)) @foreach($cart_table as $row) @php $orivar = App\AddSubVariant::withTrashed()->where('id','=',$row->variant_id)->first(); @endphp

@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').'/'.$row->pro_id.'?'.$name[0]['attr_name'].'='.$var_name[0].'&'.$name[1]['attr_name'].'='.$var_name[1]; }catch(Exception $e) { $url = url('details').'/'.$row->pro_id.'?'.$name[0]['attr_name'].'='.$var_name[0]; } @endphp {{$row->product->name}}
( @php $varinfo = App\AddSubVariant::withTrashed()->where('id','=',$row->variant_id)->first(); $varcount = count($varinfo->main_attr_value); $i=0; @endphp @foreach($varinfo->main_attr_value as $key=> $orivar) @php $getattrname = App\ProductAttributes::where('id',$key)->first()->attr_name; $getvarvalue = App\ProductValues::where('id',$orivar)->first(); @endphp @if($i < $varcount) @if(strcasecmp($getvarvalue->unit_value, $getvarvalue->values) != 0 && $getvarvalue->unit_value != null) @if($getvarvalue->proattr->attr_name == "Color" || $getvarvalue->proattr->attr_name == "Colour" || $getvarvalue->proattr->attr_name == "color" || $getvarvalue->proattr->attr_name == "colour") {{ $getvarvalue->values }}, @else {{ $getvarvalue->values }} {{ $getvarvalue->unit_value }}, @endif @else {{ $getvarvalue->values }}, @endif @else @if(strcasecmp($getvarvalue->unit_value, $getvarvalue->values) != 0 && $getvarvalue->unit_value != null) @if($getvarvalue->proattr->attr_name == "Color" || $getvarvalue->proattr->attr_name == "Colour" || $getvarvalue->proattr->attr_name == "color" || $getvarvalue->proattr->attr_name == "colour") {{ $getvarvalue->values }} @else {{ $getvarvalue->values }} {{ $getvarvalue->unit_value }} @endif @else {{ $getvarvalue->values }} @endif @endif @endforeach )