<?php if(isset($payment_page) && $payment_page): ?> <?php $payment_page = true; ?> <?php else: ?> <?php $payment_page = false; ?> <?php endif; ?> <thead> <tr> <th class="cart-sub-total"> <?php echo app('translator')->getFromJson('Products'); ?> </th> <th class="cart-sub-total"> <span class="inner-left-md"><?php echo e(Cart::count()); ?></span> </th> </tr> <tr> <th class="cart-sub-total"> <?php echo app('translator')->getFromJson('Sub Total'); ?> </th> <th class="cart-sub-total"> <span class="inner-left-md"><?php echo e(currency_format(Cart::total())); ?></span> </th> </tr> <tr> <th class="cart-sub-total"> <?php echo app('translator')->getFromJson('Tax'); ?> </th> <th class="cart-sub-total"> <span class="inner-left-md">+ <?php echo e(config('settings.tax_rate')); ?> %</span> </th> </tr> <tr> <th class="cart-sub-total"> <?php echo app('translator')->getFromJson('Shipping Cost'); ?> </th> <th class="cart-sub-total"> <span class="inner-left-md"> <?php if(config('settings.shipping_cost_valid_below') > Cart::total()): ?> <?php echo e(currency_format(config('settings.shipping_cost'))); ?> <?php else: ?> <?php echo e(currency_format(0)); ?> <?php endif; ?> </span> </th> </tr> <?php if($payment_page): ?> <?php $cal_wallet_amount = 0; ?> <?php if(config('wallet.enable')): ?> <tr> <?php
                    $available_wallet_bal   = Auth::user()->walletBalance();
                    $cal_wallet_amount  = $using_wallet_amount    = (Cart::total() * (int)(config('wallet.percent')))/100;
                ?> <?php if($available_wallet_bal >= $cal_wallet_amount): ?> <?php if(session()->has('wallet_used') && session()->get('wallet_used') == 1): ?> <?php
                            $left_wallet_bal        = $available_wallet_bal - $cal_wallet_amount;
                            $wallet_text            = 'Left Wallet balance :';
                            $checked                = 'checked';
                        ?> <?php else: ?> <?php
                            $cal_wallet_amount      = 0;
                            $left_wallet_bal        = $available_wallet_bal;
                            $wallet_text            = 'Wallet balance :';
                            $checked                = '';
                        ?> <?php endif; ?> <?php $checkbox                  = '<input type="checkbox" id="wallet_use" data-id="'.$using_wallet_amount.'" onchange="updateWalletUse()" '.$checked.'/> '; ?> <?php elseif($available_wallet_bal < $cal_wallet_amount): ?> <?php
                        $cal_wallet_amount      = 0;
                        $left_wallet_bal        = $available_wallet_bal;
                        $wallet_text            = 'Insufficient balance :';
                        $checked                = '';
                        $checkbox               = '<input type="checkbox" disabled'.$checked.'/> ';
                    ?> <?php endif; ?> <th class="cart-sub-total"> <?= $checkbox ?><?php echo app('translator')->getFromJson('Wallet Used'); ?><br> <small> ( <?php echo app('translator')->getFromJson($wallet_text); ?> <?php echo e(currency_format($left_wallet_bal,config('currency.default'))); ?> )</small> </th> <th class="cart-sub-total"> <span class="inner-left-md"> - <?php echo e(currency_format($cal_wallet_amount,config('currency.default'))); ?> </span> </th> </tr> <?php endif; ?> <?php if(session()->has('coupon_amount') && session()->has('coupon_valid_above_amount') && session('coupon_valid_above_amount') < Cart::total()): ?> <tr> <th class="cart-sub-total"> <?php echo app('translator')->getFromJson('Coupon Amount'); ?> </th> <th class="cart-sub-total"> <span class="inner-left-md"> - <?php echo e(currency_format(session('coupon_amount'))); ?> </span> </th> </tr> <?php endif; ?> <tr> <th class="cart-grand-total"> <?php echo app('translator')->getFromJson('Total'); ?> </th> <th class="cart-grand-total"> <span class="inner-left-md"> <?php if(config('settings.shipping_cost_valid_below') > Cart::total() && session()->has('coupon_amount') && session()->has('coupon_valid_above_amount') && session('coupon_valid_above_amount') < Cart::total()): ?> <?php echo e(currency_format( config('settings.shipping_cost') - $cal_wallet_amount + Cart::total() - session('coupon_amount') + (Cart::total() * config('settings.tax_rate')) / 100)); ?> <?php elseif(session()->has('coupon_amount') && session()->has('coupon_valid_above_amount') && session('coupon_valid_above_amount') < Cart::total()): ?> <?php echo e(currency_format( Cart::total() - session('coupon_amount') - $cal_wallet_amount + (Cart::total() * config('settings.tax_rate')) / 100)); ?> <?php elseif(config('settings.shipping_cost_valid_below') > Cart::total()): ?> <?php echo e(currency_format(config('settings.shipping_cost') + Cart::total() - $cal_wallet_amount + (Cart::total() * config('settings.tax_rate')) / 100)); ?> <?php else: ?> <?php echo e(currency_format(Cart::total() - $cal_wallet_amount + (Cart::total() * config('settings.tax_rate')) / 100)); ?> <?php endif; ?> </span> </th> </tr> <?php else: ?> <tr> <th class="cart-grand-total"> <?php echo app('translator')->getFromJson('Grand Total'); ?> </th> <th class="cart-grand-total"> <span class="inner-left-md"> <?php if(config('settings.shipping_cost_valid_below') > Cart::total()): ?> <?php echo e(currency_format(config('settings.shipping_cost') + Cart::total() + (Cart::total() * config('settings.tax_rate')) / 100)); ?> <?php else: ?> <?php echo e(currency_format(Cart::total() + (Cart::total() * config('settings.tax_rate')) / 100)); ?> <?php endif; ?> </span> </th> </tr> <?php endif; ?> </thead>