@php $subtotalRaw = Cart::instance('pos_shopping')->subtotal(); $subtotalNum = (float) preg_replace('/[^\d.]/', '', (string) $subtotalRaw); $shippingNum = (float) (Session::get('pos_shipping') ?? 0); $couponDiscount = (float) (Session::get('pos_discount') ?? 0); $grandTotal = max(0, $subtotalNum + $shippingNum - $couponDiscount); @endphp