|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/liminfinity.edukrypt.in/resources/views/ |
Upload File : |
@extends('master')
@section('content')
<div class="main-wrapper scrollspy-container">
<div class="breadcrumb-wrapper">
<div class="container">
<h1 class="page-title">Shopping Cart</h1>
<div class="row">
<div class="col-xs-12 col-sm-8">
<ol class="breadcrumb">
<li><a href="#">Home</a></li>
<li class="active">Cart</li>
</ol>
</div>
@include('includes.breadcrum')
</div>
</div>
</div>
<div class="equal-content-sidebar-by-gridLex right-sidebar">
<div class="container">
@if( $carts != null)
<div class="GridLex-grid-noGutter-equalHeight">
<div class="GridLex-col-9_sm-8_xs-12_xss-12">
<div class="content-wrapper">
<x-flashMessage/>
<?php
$grandTotal = 0;
$mrpTotal = 0;
$discountPercent = 0;
$couponApplyName="";
$couponApplyStatus = "no";
$couponDiscount = 0;
?>
<div class="blog-item">
@foreach($carts as $cart)
<?php
$priceAfterdiscount = ($cart['price']*$cart['discount_percnt'])/100;
$chooseDiscountPrice = ($cart['max_discount']>$priceAfterdiscount)?$cart['max_discount']:$priceAfterdiscount;
$finalProductPrice = round($cart['price']- $chooseDiscountPrice);
if($cart['coupon_apply_status'] == 'yes')
{
$finalProductPrice = $finalProductPrice - $cart['coupon_discount_amount'];
$couponApplyStatus = "yes";
$couponApplyName = $cart['coupon_name'];
}
$grandTotal +=$finalProductPrice;
$mrpTotal +=$cart['price'];
if($mrpTotal>0){
$discountPercent = round(((($mrpTotal-$grandTotal)/$mrpTotal)*100));
}
// exit;
?>
<div style="border:1px solid #f1f1f1; padding: 10px;" class="teacher-item-list-02 clearfix">
<div class="row gap-20">
<div class="col-xs-12 col-sm-3 col-md-2">
<img src="{{ asset('public/uploads/products/').'/'.$cart['image']}}" alt="Image" />
</div>
<div class="col-xs-12 col-sm-6 col-md-7">
<div class="content">
<h5 style="margin-bottom:0px"><a href="javascript:;">{{$cart['name']}}</a></h5>
<p class="short-info">
{!!'<b>Mode</b>: '. ucfirst(str_replace('_',' ',$cart['mode']))!!} |
{!!'<b>Duration</b>: '.$cart['duration'].' days'!!} |
{!!'<b>Views</b>: '.$cart['views']!!} <br>
{{'By '.$cart['teacher']}}
</p>
</div>
</div>
<div class="col-xs-12 col-sm-3 col-md-1">
<a class="text-danger" href="{{asset('remove-cart/'.$cart['productId'])}}">Remove</a>
</div>
<div class="col-xs-12 col-sm-3 col-md-2">
<h5 style="margin-bottom: 0px" class="pull-right">
<a href="javascript:;">
<i class="fa fa-inr"></i>
{{$finalProductPrice}} <i class="fa fa-tag"></i>
</a>
</h5>
<div class="clearfix"></div>
<a class="pull-right" style="margin-right:18px;text-decoration: line-through;" href="javascript:;">
<i style="text-decoration: line-through" class="fa fa-inr"></i>{{$cart['price']}}
</a>
</div>
</div>
</div>
@endforeach
</div>
</div>
</div>
{{-- Aside Bar Checkout --}}
<div class="GridLex-col-3_sm-4_xs-12_xss-12">
<aside class="sidebar-wrapper">
<h4 style="margin-bottom:0px;">Total:</h4>
<h3 style="color: black; font-weight: bold; margin-top:0px; margin-bottom:0px;"><i class="fa fa-inr fa-1x"></i> {{$grandTotal}}</h3>
<h5 style="color:gray; margin-top:0px;margin-bottom:0px; text-decoration: line-through;">
<i class="fa fa-inr" style="text-decoration: line-through;"></i>{{$mrpTotal}}
</h5>
<h5 style="margin-top:0px;color:gray;">
{{$discountPercent.'% off'}}
</h5>
@if(empty(Session::get('login_data')['id']))
<a href="{{asset('sign-in')}}" class="btn btn-primary btn-lg" style="width: 100%;border-radius: 0px;">Sign In</a>
@else
<a href="{{asset('checkout')}}" class="btn btn-primary btn-lg" style="width: 100%;border-radius: 0px;" type="submit">Checkout</a>
@endif
<hr>
<form method="post" action="{{asset('apply-promocode')}}">
@csrf
<div class="form-group">
<div class="row">
<div class="col-md-12">
<input {{($couponApplyStatus == 'yes')?'readonly':'';}} type="text" style="vertical-align:middle;text-transform:uppercase;" value="{{$couponApplyName}}" name="coupon" class="form-control" placeholder="Apply Coupon Code" />
</div>
<div class="col-md-12">
@if($couponApplyStatus == 'yes')
<a href="{{asset('/remove-promocode')}}" style="vertical-align:middle;width: 100%;border-radius: 0px;" type="submit" class="btn btn-danger btn-sm" >Remove applied code</a>
@else
<button style="vertical-align:middle;width: 100%;border-radius: 0px;" type="submit" class="btn btn-info btn-sm" >Apply coupon code</button>
@endif
</div>
</div>
</div>
</form>
</aside>
</div>
</div>
@else
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div style="min-height: 200px; margin-top: 80px;">
<center>
<i style="font-size: 100px;" class="fa fa-shopping-cart"></i>
<h4 class="text-center">Your cart is empty. Keep shopping to <span class="text-black-50"><a href="{{asset('courses')}}">find a course!</a></span></h4>
</center>
</div>
</div>
</div>
@endif
</div>
</div>
</div>
@endsection
@push('footer-script')
@endpush