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

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

@if(Auth::check()) @foreach($cart_table as $row) @php $orivar = $row->variant; @endphp @isset($orivar)

{{$row->product->name}}
( {{ variantname($row->variant) }} )

@if(count($row->product->reviews)) @php $review_t = 0; $price_t = 0; $value_t = 0; $sub_total = 0; $count = $row->product->reviews()->count(); foreach($row->product->reviews as $review){ $review_t = $review->price*5; $price_t = $review->price*5; $value_t = $review->value*5; $sub_total = $sub_total + $review_t + $price_t + $value_t; } $count = ($count*3) * 5; if($count != 0){ $rat = $sub_total/$count; $ratings_var = ($rat*100)/5; } @endphp

@else {{ __("No Rating") }}
@endif
{{ __('staticwords.SoldBy') }}: {{$row->product->store->name}}
@foreach($row->variant->main_attr_value as $key=> $orivar) @php $getattrname = App\ProductAttributes::where('id',$key)->first()->attr_name; $getvarvalue = App\ProductValues::where('id',$orivar)->first(); @endphp @php $k = '_'; @endphp @if (strpos($getattrname, $k) == false) {{ $getattrname }}: @else {{str_replace('_', ' ', $getattrname)}}: @endif @if(isset($getvarvalue) && 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")
@else {{ $getvarvalue->values }} {{ $getvarvalue->unit_value ?? '' }} @endif
@else {{ $getvarvalue->values }}
@endif @endforeach
@if(isset($row->product->cashback_settings) && $row->product->cashback_settings->enable == 1)

{{ __("Congrats ! You can earn cashback in your wallet") }} {{ $row->product->cashback_settings->discount_type }} @if($row->product->cashback_settings->cashback_type == 'fix') {{ price_format($row->product->cashback_settings->discount * $conversion_rate) }} @else {{ $row->product->cashback_settings->discount.'%' }} @endif

@endif @if($row->variant->stock ==0)

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

@endif
@if($row->semi_total == 0) {{price_format($row->price_total*$conversion_rate,2)}} @else {{price_format($row->semi_total*$conversion_rate,2)}} {{sprintf("%.2f",$row->price_total*$conversion_rate,2)}} @endif
@endisset @if($row->simple_product)

{{ $row->simple_product->product_name }}

@if(count($row->simple_product->reviews->where('status','1'))) @php $review_t = 0; $price_t = 0; $value_t = 0; $sub_total = 0; $count = $row->simple_product->reviews()->where('status','1')->count(); foreach($row->simple_product->reviews->where('status','1') as $review){ $review_t = $review->price*5; $price_t = $review->price*5; $value_t = $review->value*5; $sub_total = $sub_total + $review_t + $price_t + $value_t; } $count = ($count*3) * 5; if($count != 0){ $rat = $sub_total/$count; $ratings_var = ($rat*100)/5; } @endphp

@else {{ __('No Rating') }}
@endif
{{ __('staticwords.SoldBy') }}: {{$row->simple_product->store->name}} @if(isset($row->simple_product->cashback_settings) && $row->simple_product->cashback_settings->enable == 1)

{{ __("Congrats ! You can earn cashback in your wallet") }} {{ $row->simple_product->cashback_settings->discount_type }} @if($row->simple_product->cashback_settings->cashback_type == 'fix') {{ price_format( $row->simple_product->cashback_settings->discount * $conversion_rate) }} @else {{ $row->simple_product->cashback_settings->discount.'%' }} @endif

@endif @if($row->simple_product->stock ==0)

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

@endif
@if($row->semi_total == 0) {{price_format($row->price_total*$conversion_rate)}} @else {{price_format($row->semi_total*$conversion_rate)}} {{price_format($row->price_total*$conversion_rate)}} @endif
@endif
@endforeach @else @if(!empty(session()->get('cart'))) @foreach($cts = Session::get('cart') as $ckey=> $row)
{{ csrf_field() }} @php $pro = App\Product::withTrashed()->where('id',$row['pro_id'])->first(); $orivar = App\AddSubVariant::withTrashed()->where('id','=',$row['variantid'])->first(); @endphp