@php $total = 0; $carts = get_user_cart(); if(count($carts) > 0) { foreach ($carts as $key => $cartItem) { $product = get_single_product($cartItem['product_id']); $total = $total + cart_product_price($cartItem, $product, false) * $cartItem['quantity']; } } @endphp {{ single_price($total) }} ({{count($carts) > 0 ? count($carts) : 0 }} {{translate('Items')}})