@extends("front/layout.master") @section('title', __('staticwords.ShoppingCart') . ' | ') @section('body') @php use App\Http\Controllers\Api\CurrencyController; @endphp
@php $pro = Session('pro_qty'); $value = Session::get('cart'); if (Auth::check()) { $count = count($cart_table); } 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)

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

@if (Session::has('validcurrency'))
{{ __('staticwords.Oscur') }} {{ Session::get('currency')['id'] }} {{ __('staticwords.CerrorMsg') }} !
@endif
@if (Auth::check()) @foreach ($cart_table as $row) @php $orivar = $row->variant; @endphp @if ($row->simple_product)
@php $category = App\Category::with('simpleproducts')->where('id','=',$row->simple_product->category_id)->first(); $cat_slug = str_slug($category->title, '-', app()->getLocale()); $subcategory =App\Subcategory::with('simpleproducts')->where('id','=',$row->simple_product->subcategory_id)->first(); $subcat_slug = str_slug($subcategory->title, '-', app()->getLocale()); @endphp @if ($row->simple_product->thumbnail != '') @if ($row->simple_product->thumbnail != '' && file_exists(public_path() . '/images/simple_products/' . $row->simple_product->thumbnail)) @else {{ $row->simple_product->thumbnail }} @endif @else No Image @endif
@php $category = App\Category::with('simpleproducts')->where('id','=',$row->simple_product->category_id)->first(); $cat_slug = str_slug($category->title, '-', app()->getLocale()); $subcategory =App\Subcategory::with('simpleproducts')->where('id','=',$row->simple_product->subcategory_id)->first(); $subcat_slug = str_slug($subcategory->title, '-', app()->getLocale()); @endphp {{ $row->simple_product->product_name }}
{{ get_username($row->simple_product->store->user_id) }}
@if (!empty($product->material)) Material : {{ $product->material }} @endif @if (!empty($product->material) && !empty($product->size))
@endif
@php $new_conversion_rate = new CurrencyController; $new_conversion_rate = $new_conversion_rate->newfetchRates(session()->get('currency')['id'],$row->simple_product->id)->getData()->exchange_rate; @endphp
@if ($row->semi_total == 0)
{{ price_format($row->price_total * $new_conversion_rate) }}
@else
{{ price_format($row->semi_total * $new_conversion_rate) }}
{{ price_format($row->price_total * $new_conversion_rate) }}
@endif
@endif
@endforeach @else @php $value = Session('cart'); @endphp @foreach ($value as $row)
@php $category = App\Category::with('simpleproducts')->where('id','=',$row->category_id)->first(); $cat_slug = str_slug($category->title, '-', app()->getLocale()); $subcategory =App\Subcategory::with('simpleproducts')->where('id','=',$row->subcategory_id)->first(); $subcat_slug = str_slug($subcategory->title, '-', app()->getLocale()); @endphp @if ($row->thumbnail != '') @if ($row->thumbnail != '' && file_exists(public_path() . '/images/simple_products/' . $row->thumbnail)) @else {{ $row->thumbnail }} @endif @else No Image @endif
@php $category = App\Category::with('simpleproducts')->where('id','=',$row->category_id)->first(); $cat_slug = str_slug($category->title, '-', app()->getLocale()); $subcategory =App\Subcategory::with('simpleproducts')->where('id','=',$row->subcategory_id)->first(); $subcat_slug = str_slug($subcategory->title, '-', app()->getLocale()); @endphp {{ $row->product_name }}
{{ get_username($row->store->user_id) }}
@if (!empty($row->material)) Material : {{ $row->material }} @endif @if (!empty($row->material) && !empty($row->size))
@endif
@php $new_conversion_rate = new CurrencyController; $new_conversion_rate = $new_conversion_rate->newfetchRates(session()->get('currency')['id'],$row->id)->getData()->exchange_rate; @endphp
@if ($row->offer_price == 0)
{{ price_format($row->price * $new_conversion_rate) }}
@else
{{ price_format($row->offer_price * $new_conversion_rate) }}
{{ price_format($row->price * $new_conversion_rate) }}
@endif

@endforeach @endif
@if (Session::has('fail'))
{{ Session::get('fail') }}
@endif @if (Auth::check() && App\Cart::isCoupanApplied() == 1)
{{ App\Cart::getCoupanDetail()->code . ' applied successfully !' }}
@csrf
@endif @if (Session::has('coupanapplied'))
{{ session()->get('coupanapplied')['code'] . ' applied successfully !' }}
@csrf
@endif
@csrf

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

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

{{ __('staticwords.Subtotal') }}
@php $total = 0; @endphp @auth @php $cart_table = App\Cart::where('user_id', auth()->user()->id)->get(); $oot = []; @endphp @if (!empty($cart_table)) @foreach ($cart_table as $c) @php $new_conversion_rate = new CurrencyController; $new_conversion_rate = $new_conversion_rate->newfetchRates(session()->get('currency')['id'],$c->simple_pro_id)->getData()->exchange_rate; @endphp @if ($c->semi_total == '' || $c->semi_total == null) @php $price = $c->price_total* $new_conversion_rate; @endphp @else @php $price = $c->semi_total* $new_conversion_rate; @endphp @endif @php $total= $total+$price; @endphp @endforeach @endif {{ sprintf('%.2f', $total , 2) }} @else @if (!empty(Session::get('cart'))) @php $oot = []; @endphp @foreach ($cts = Session::get('cart') as $key => $c) @php $new_conversion_rate = new CurrencyController; $new_conversion_rate = $new_conversion_rate->newfetchRates(session()->get('currency')['id'],$c['id'])->getData()->exchange_rate; @endphp @if ($c->offer_price == '' || $c->offer_price == null || $c->offer_price == '0.0') @php $price = $c->price* $new_conversion_rate; @endphp @else @php $price = $c->offer_price* $new_conversion_rate; @endphp @endif @php $total = $total + $price; @endphp @endforeach {{ sprintf('%.2f', $total , 2) }} @endif @endauth
@if ($shipping != 0) {{ price_format($shipping * $conversion_rate, 2) }} @else {{ __('staticwords.inclusive') }} @endif
@if (App\Cart::isCoupanApplied() == '1')
{{ __('staticwords.Discount') }}
- {{ price_format(App\Cart::getDiscount()) }}
@endif
{{ __('staticwords.GrandTotal') }}
@php $total = sprintf('%.2f', $total); if (App\Cart::isCoupanApplied() == '1') { $gtotal = $total - sprintf(App\Cart::getDiscount()); } else { $gtotal=$total; } @endphp @if (!Auth::check()) @if (Session::has('cart')) @endif @endif {{ price_format($gtotal) }}
@auth @else