@php
$mrp_total = 0;
$sale_total = 0;
@endphp
@foreach ($cartItems as $item)
@php
$mrp_total += $item->product->mrp * $item->quantity;
$sale_total += $item->product->sales_price * $item->quantity;
@endphp
{{ $item->product->product_name }} × {{ $item->quantity }}
Code: {{ $item->product->product_code }}
₹{{ amountFormat($item->product->mrp * $item->quantity) }}
₹{{ amountFormat($item->product->sales_price * $item->quantity) }}
{{ $item->product->discount }}% Off
@endforeach
@php
$coinValue = getSetting('coin_value');
$coins_max_use = (float) getSetting('coins_max_use');
$coins_max_use_by = trim(getSetting('coins_max_use_by'));
$coin_discount = 0;
if ($coinValue > 0) {
$maxDiscountAllowed = max(0, $totals['final_total'] - 1);
$coinsToUse = floor($maxDiscountAllowed / $coinValue);
// Apply coins_max_use limit
if ($coins_max_use_by === '%') {
$maxBySetting = floor(($totals['final_total'] * $coins_max_use) / 100);
} else {
$maxBySetting = (int) $coins_max_use;
}
$coinsToUse = min($coinsToUse, $maxBySetting);
$coin_discount = $coinsToUse * $coinValue;
} else {
$coinsToUse = 0;
}
@endphp
Item Total₹{{ amountFormat($mrp_total) }}
Discount-₹{{ amountFormat($mrp_total - $sale_total) }}
Delivery Charges₹{{ amountFormat($totals['delivery_charges']) }}
Branding Charges₹{{ amountFormat($totals['branding_charges']) }}
Coins Discount-₹{{ amountFormat($coin_discount) }}
{{-- GST₹{{ $totals['gst'] }} --}}
Total Payable₹{{ amountFormat($totals['final_total'] - $coin_discount) }}