@extends("front/layout.master") @section('title',__('staticwords.YourCompareList').' - ') @section("body") @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

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

@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 $pro) @php $product = App\Product::find($pro['proid']); @endphp @if(isset($product) && $product->status == 1) @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); } } }else{ $commission_amount = 0; $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 @endforeach @endif @endforeach @foreach(Session::get('comparison') as $pro) @php $product = App\Product::find($pro['proid']); @endphp @if(isset($product) && $product->status == 1)
{{ __('staticwords.Products') }} @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 @endif @endforeach
@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 {{ __('staticwords.Removefromcart') }} @else {{ __('staticwords.Removefromcart') }} @endif @else @if($price_login != 1)
@csrf
@endif @endif
{{ __('staticwords.Rating') }}