@extends("frontend.layout.master") @section('title','Emart | Contact us') @section("content")
@php if(Session::has('comparison')){ $clist = Session::get('comparison'); foreach ($clist as $k => $row) { $findpro = App\Product::find($row); if(!isset($findpro)){ unset($clist[$k]); } } Session::put('comparison',$clist); } @endphp
@if(!empty(Session::get('comparison')))
@foreach(Session::get('comparison') as $pro) @php $product = App\Product::find($pro['proid']); @endphp @if(isset($product) && $product->status == 1) @endif @endforeach @foreach(Session::get('comparison') as $product) @php $pro = App\Product::find($product['proid']); @endphp @if(isset($pro) && $pro->status == 1) @endif @endforeach @foreach(Session::get('comparison') as $pro) @php $product = App\Product::find($pro['proid']); @endphp @if(isset($product) && $product->status == 1) @endif @endforeach @foreach(Session::get('comparison') as $product) @php $product = App\Product::find($product['proid']); @endphp @if(isset($product) && $product->status == 1) @endif @endforeach @foreach(Session::get('comparison') as $pro) @php $product = App\Product::find($pro['proid']); @endphp @if(isset($product) && $product->status == 1) @endif @endforeach @foreach(Session::get('comparison') as $product) @php $pro = App\Product::find($product['proid']); @endphp @if(isset($pro) && $pro->status == 1) @endif @endforeach
{{__('Product')}} @foreach($product->subvariants as $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 = $orivar->products->vender_price+$orivar->price+$commission_amount; $totalsaleprice = $orivar->products->vender_offer_price + $orivar->price + $commission_amount; if($orivar->products->vender_offer_price == 0){ $show_price = $totalprice; }else{ $totalsaleprice; $convert_price = $totalsaleprice =='' ? $totalprice:$totalsaleprice; $show_price = $totalprice; } }else{ $totalprice = ($orivar->products->vender_price+$orivar->price)*$commission_amount; $totalsaleprice = ($orivar->products->vender_offer_price+$orivar->price)*$commission_amount; $buyerprice = ($orivar->products->vender_price+$orivar->price)+($totalprice/100); $buyersaleprice = ($orivar->products->vender_offer_price+$orivar->price)+($totalsaleprice/100); if($orivar->products->vender_offer_price ==0){ $show_price = round($buyerprice,2); }else{ round($buyersaleprice,2); $convert_price = $buyersaleprice==''?$buyerprice:$buyersaleprice; $show_price = $buyerprice; } } }else{ $comm = App\Commission::where('category_id',$product->category_id)->first(); if(isset($comm)){ if($comm->type=='f'){ $price = $orivar->products->vender_price + $comm->rate + $orivar->price; if($orivar->products->vender_offer_price != null){ $offer = $orivar->products->vender_offer_price + $comm->rate + $orivar->price; }else{ $offer = $orivar->products->vender_offer_price; } if($orivar->products->vender_offer_price == 0 || $orivar->products->vender_offer_price == null){ $show_price = $price; }else{ $convert_price = $offer; $show_price = $price; } } else{ $commission_amount = $comm->rate; $totalprice = ($orivar->products->vender_price+$orivar->price)*$commission_amount; $totalsaleprice = ($orivar->products->vender_offer_price+$orivar->price)*$commission_amount; $buyerprice = ($orivar->products->vender_price+$orivar->price)+($totalprice/100); $buyersaleprice = ($orivar->products->vender_offer_price+$orivar->price)+($totalsaleprice/100); if($orivar->products->vender_offer_price == 0){ $show_price = round($buyerprice,2); }else{ $convert_price = round($buyersaleprice,2); $convert_price = $buyersaleprice==''?$buyerprice:$buyersaleprice; $show_price = round($buyerprice,2); } } } } $convert_price_form = $convert_price; $show_price_form = $show_price; $convert_price = $convert_price*$conversion_rate; $show_price = $show_price*$conversion_rate; @endphp @endif @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') . '/'. str_replace(' ','-',$product->name) .'/' . $product->id . '?' . $name[0]['attr_name'] . '=' . $var_name[0] . '&' . $name[1]['attr_name'] . '=' . $var_name[1]; } catch (\Exception $e) { $url = url('details') . '/' .str_replace(' ','-',$product->name) .'/' . $product->id . '?' . $name[0]['attr_name'] . '=' . $var_name[0]; } @endphp

{{ $product->name }}

@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 = $orivar->products->vender_price+$orivar->price+$commission_amount; $totalsaleprice = $orivar->products->vender_offer_price + $orivar->price + $commission_amount; if($orivar->products->vender_offer_price == 0){ $show_price = $totalprice; }else{ $totalsaleprice; $convert_price = $totalsaleprice =='' ? $totalprice:$totalsaleprice; $show_price = $totalprice; } }else{ $totalprice = ($orivar->products->vender_price+$orivar->price)*$commission_amount; $totalsaleprice = ($orivar->products->vender_offer_price+$orivar->price)*$commission_amount; $buyerprice = ($orivar->products->vender_price+$orivar->price)+($totalprice/100); $buyersaleprice = ($orivar->products->vender_offer_price+$orivar->price)+($totalsaleprice/100); if($orivar->products->vender_offer_price ==0){ $show_price = round($buyerprice,2); }else{ round($buyersaleprice,2); $convert_price = $buyersaleprice==''?$buyerprice:$buyersaleprice; $show_price = $buyerprice; } } }else{ $comm = App\Commission::where('category_id',$product->category_id)->first(); if(isset($comm)){ if($comm->type=='f'){ $price = $orivar->products->vender_price + $comm->rate + $orivar->price; if($orivar->products->vender_offer_price != null){ $offer = $orivar->products->vender_offer_price + $comm->rate + $orivar->price; }else{ $offer = $orivar->products->vender_offer_price; } if($orivar->products->vender_offer_price == 0 || $orivar->products->vender_offer_price == null){ $show_price = $price; }else{ $convert_price = $offer; $show_price = $price; } } else{ $commission_amount = $comm->rate; $totalprice = ($orivar->products->vender_price+$orivar->price)*$commission_amount; $totalsaleprice = ($orivar->products->vender_offer_price+$orivar->price)*$commission_amount; $buyerprice = ($orivar->products->vender_price+$orivar->price)+($totalprice/100); $buyersaleprice = ($orivar->products->vender_offer_price+$orivar->price)+($totalsaleprice/100); if($orivar->products->vender_offer_price == 0){ $show_price = round($buyerprice,2); }else{ $convert_price = round($buyersaleprice,2); $convert_price = $buyersaleprice==''?$buyerprice:$buyersaleprice; $show_price = round($buyerprice,2); } } } } $convert_price_form = $convert_price; $show_price_form = $show_price; $convert_price = $convert_price*$conversion_rate; $show_price = $show_price*$conversion_rate; @endphp @endif @endif @if($price_login != 1) @if($convert_price != 0) {{ $convert_price }} {{ $show_price }} @else {{ $show_price }} @endif @else {{ __('Login to view price') }} @endif
@php $incartcheck = 0; if(Auth::check()){ $incart = App\Cart::where('user_id',Auth::user()->id)->where('variant_id',$orivar->id)->first(); if (isset($incart)) { $incartcheck = 1; }else{ $incartcheck = 0; } }else{ if(!empty(Session::has('cart'))){ foreach (Session::get('cart') as $comp) { if($orivar->id == $comp['variantid']){ $incartcheck = 1; break; } } } } @endphp @if($incartcheck == 1) @auth {{ __('Remove From Cart')}} @else {{ __('Remove From Cart') }} @endif @else @if($price_login != 1)
@csrf
@endif @endif
@endif @endforeach
{{__('Ratings')}}
{{__('Description')}}{!! $pro->des !!}
{{__('Availability')}} @foreach($product->subvariants as $orivar) @if($orivar->def == 1) @if($orivar->stock > 0) {{__('In Stock')}} @else {{__('Out of Stock')}} @endif @endif @endforeach
{{__('Weight')}} @foreach($product->subvariants as $orivar) @if($orivar->def == 1) @if(isset($orivar->unitname['short_code']))

{{ $orivar->weight.$orivar->unitname['short_code'] }}

@endif @endif @endforeach
{{__('Specification')}} @if(count($product->specs)>0) @foreach($product->specs as $spec) @endforeach
{{ $spec->prokeys }} {{ $spec->provalues }}
@else - @endif
{{__('Remove')}}
@else

{{__('Compare list is empty')}}

@endif
@endsection @section('script')