@extends('theme.master') @section('title', 'Cart') @section('content') @include('admin.message') @php $gets = App\Breadcum::first(); @endphp @if(isset($gets)) @if($gets['img'] !== NULL && $gets['img'] !== '') @else @endif {{ __('Shopping Cart') }} @endif @php if(Auth::check()) { $item = App\Cart::where('user_id', Auth::User()->id)->get(); } else{ } if($item != NULL){ echo count($item); } else{ echo "0"; } @endphp {{ __('Courses in Cart') }} @if($carts != NULL) @auth @foreach($carts as $cart) @if($cart->course_id != NULL) @if($cart->courses['preview_image'] !== NULL && $cart->courses['preview_image'] !== '') @else @endif @else @if($cart->bundle['preview_image'] !== NULL && $cart->bundle['preview_image'] !== '') @else @endif @endif @if($cart->course_id != NULL) {{ str_limit($cart->courses->title, $limit = 50, $end = '...') }} {{ $cart->courses->user->fname }} @else {{ str_limit($cart->bundle->title, $limit = 50, $end = '...') }} {{ $cart->bundle->user->fname }} @endif {{ csrf_field() }} {{ __('Remove') }} {{ csrf_field() }} {{ __('Remove to Wishlist') }} @if($cart->offer_price == !NULL) {{ activeCurrency()->getData()->position == 'l' ? activeCurrency()->getData()->symbol :'' }}{{ price_format( currency($cart->offer_price, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = false) )}}{{ activeCurrency()->getData()->position == 'r' ? activeCurrency()->getData()->symbol :'' }} {{ activeCurrency()->getData()->position == 'l' ? activeCurrency()->getData()->symbol :'' }}{{ price_format( currency($cart->price, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = false)) }}{{ activeCurrency()->getData()->position == 'r' ? activeCurrency()->getData()->symbol :'' }} @else {{ activeCurrency()->getData()->position == 'l' ? activeCurrency()->getData()->symbol :'' }}{{ price_format( currency($cart->price, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = false)) }}{{ activeCurrency()->getData()->position == 'r' ? activeCurrency()->getData()->symbol :'' }} @endif @if($cart->disamount == !NULL) @if(Session::has('coupanapplied')) @endif @endif @endforeach @endauth @guest @foreach($carts as $c) @php $cart = App\Course::where('id', $c)->where('status', '1')->first(); @endphp @if($cart->preview_image !== NULL && $cart->preview_image !== '') @else @endif {{ str_limit($cart->title, $limit = 50, $end = '...') }} {{ $cart->user->fname }} {{ csrf_field() }} {{ __('Remove') }} @if($cart->discount_price == !NULL) {{ currency($cart->discount_price, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = true) }} {{ currency($cart->price, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = true) }} @else {{ currency($cart->price, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = true) }} @endif @if($cart->disamount == !NULL) @if(Session::has('coupanapplied')) @endif @endif @endforeach @endguest @if(count($item)>0) @php if(auth::check()) { $cartitems = App\Cart::where('user_id', Auth::User()->id)->first(); } else { $cartitems = session()->get('cart.add_to_cart'); } @endphp @if ($cartitems == NULL) {{ __('empty') }} @else {{ __('Total') }}: {{ __('Total Price') }}{{ activeCurrency()->getData()->position == 'l' ? activeCurrency()->getData()->symbol :'' }} {{ price_format( currency($price_total, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = false)) }}{{ activeCurrency()->getData()->position == 'r' ? activeCurrency()->getData()->symbol :'' }} {{ __('Offer Discount') }} {{ activeCurrency()->getData()->position == 'l' ? activeCurrency()->getData()->symbol :'' }} {{ price_format( currency($price_total - $offer_total, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = false)) }}{{ activeCurrency()->getData()->position == 'r' ? activeCurrency()->getData()->symbol :'' }} {{ __('Coupon Discount') }} @if( $cpn_discount == !NULL) - {{ currency($cpn_discount, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = true) }} @else {{ __('ApplyCoupon') }} @endif {{ __('Discount Percent') }}{{ round($offer_percent, 0) }}% {{ __('off') }} {{ __('Total') }}:{{ activeCurrency()->getData()->position == 'l' ? activeCurrency()->getData()->symbol :'' }} {{ price_format( currency($cart_total, $from = $currency->code, $to = Session::has('changed_currency') ? Session::get('changed_currency') : $currency->code, $format = false)) }}{{ activeCurrency()->getData()->position == 'r' ? activeCurrency()->getData()->symbol :'' }} @if(round($cart_total) == 0) {{ __('Enroll Now') }} @else @if(auth::check()) @csrf @php session()->put('price_total',$price_total); session()->put('offer_total',$offer_total); session()->put('offer_percent',$offer_percent); session()->put('cart_total',$cart_total); @endphp {{ __('Checkout') }} @else {{ __('Checkout') }} @endif @endif @endif @auth {{ csrf_field() }} {{ __('Apply') }} @endauth @if(Session::has('fail')) × {{ Session::get('fail') }} @endif @if(Session::has('coupanapplied')) {{ csrf_field() }} {{Session::get('coupanapplied')['msg']}} @endif @endif @else {{ __('cart empty') }} {{ __('Keep Shopping') }} @endif @auth {{ __('Coupon Code') }} × {{ csrf_field() }} {{ __('Apply') }} @if($item != NULL) @php $cpns = App\Coupon::get(); $mytime = Carbon\Carbon::now(); @endphp @foreach($cpns as $cpn) @if($cpn->expirydate >= $mytime && $cpn->show_to_users == 1) {{ $cpn->code }} @endif @endforeach @endif @endauth @endsection