@php use Botble\Base\Facades\BaseHelper; use Botble\Ecommerce\Facades\Cart; use Botble\Ecommerce\Facades\EcommerceHelper; use Botble\Media\Facades\RvMedia; @endphp @if (is_plugin_active('ecommerce')) @php $cartContent = Cart::instance('cart')->content(); $cartCount = Cart::instance('cart')->count(); $cartSubtotal = (float) Cart::instance('cart')->rawSubTotal(); $cartTax = (float) Cart::instance('cart')->rawTax(); $cartTotal = (float) Cart::instance('cart')->rawTotal(); $taxEnabled = EcommerceHelper::isTaxEnabled(); $showRecommendations = (bool) theme_option('mini_cart_show_recommendations', true); $freeshipThreshold = (float) theme_option('mini_cart_freeship_threshold', 100); $freeshipRemaining = max(0, $freeshipThreshold - $cartSubtotal); $freeshipProgress = $freeshipThreshold > 0 ? min(100, round(($cartSubtotal / $freeshipThreshold) * 100, 2)) : 0; $freeshipUnlocked = $freeshipThreshold > 0 && $cartSubtotal >= $freeshipThreshold; @endphp @endif