@extends('web.home.layout.master') @section('content')
Home Cart Checkout

Complete Your Cart Order

Please enter your shipping details and select a payment method below.

{{-- Professional Error Alerts --}} @if ($errors->any() || session('error'))

Information Required to Proceed

    @if(session('error'))
  • {{ session('error') }}
  • @endif @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if (session('success')) @endif @php $user = Auth::user(); $cartData = App\Models\Cart::where('userid', $user->id)->get(); $total = 0; foreach ($cartData as $cartItem) { $total += $cartItem->total; } $cartproduct = App\Models\Cart::where('userid', $user->id)->get(); $totalPrice = 0; $totalWeightInGrams = 0; $taxSubtotal = 0; $taxBaseSetting = \App\Models\SystemSetting::get('tax_calculation_base', 'selling_price'); $taxRateSetting = (float) \App\Models\SystemSetting::get('corporate_tax_percentage', 18.00); foreach ($cartproduct as $product) { $productData = App\Models\Product::where('id', $product->productid)->first(); $totalPrice += $product->total; $totalWeightInGrams += ($productData->weight ?? 0) * $product->qty; $taxBasePrice = ($taxBaseSetting === 'cutted_price' && isset($productData->cutted_price) && $productData->cutted_price > 0) ? $productData->cutted_price : $product->product_price; $taxSubtotal += $taxBasePrice * $product->qty; } $totalWeightInKg = $totalWeightInGrams / 1000; if ($totalWeightInKg > 1) { $shippingPrice = ceil($totalWeightInKg - 1) * 100; } else { $shippingPrice = 0; } $totalPriceWithShipping = $totalPrice + $shippingPrice; // Hidden CSV lists for JS Session initialization $product_id = ''; $qty = ''; $color = ''; foreach ($cartData as $item) { $product_id .= $item['productid'] . ','; $qty .= $item['qty'] . ','; $color .= $item['color'] . ','; } $cart_product_id = rtrim($product_id, ','); $cart_qty = rtrim($qty, ','); $cart_color = rtrim($color, ','); // Get userdata $userdata = App\Models\Userdata::where('userid', $user->id)->first(); @endphp
@csrf @include('web.home.checkout.partials.shipping_fields')
@include('web.home.checkout.partials.payment_methods')
@endsection