@php
$user = Auth::user();
@endphp
@if ($user == null)
@endif
@php
$productdata = App\Models\Product::where('id', $productid)->first();
$total = $productprice * $quantity;
@endphp
@php
try {
$user = Auth::user();
$totalPrice = 0;
$totalWeightInGrams = 0;
$productdata = App\Models\Product::where('id', $productid)->first();
$totalWeightInGrams = $productdata->weight * $quantity;
$totalWeightInKg = $totalWeightInGrams / 1000;
// Calculate shipping price based on total weight in kilograms
if ($totalWeightInKg > 1) {
$shippingPrice = $totalWeightInKg * 80;
} else {
$shippingPrice = 0;
} // LKR 80 per kg
$totalPriceWithShipping = $totalPrice + $shippingPrice;
} catch (\Throwable $th) {
DB::table('error_logs')->insert([
'message' => $th->getMessage(),
'file' => $th->getFile(),
'line' => $th->getLine(),
'trace' => $th->getTraceAsString(),
'created_at' => now(),
]);
}
@endphp
Product
Price
Color
Qty
Subtotal
{{ $productdata->product_name }}
LKR {{ number_format($productprice, 2) }}
{{ $quantity }}
LKR {{ number_format($total, 2) }}
Shipping (Included Weight*)
LKR 0.00
Total
LKR 0.00
Make your payment directly into our bank
account. Please use your Order ID as the payment reference. Your
order won't be shipped until the funds have cleared in our account.
I agree with the terms and
conditions
Place
order
@endsection