@php add_js_src(theme_asset('js/filter.js')); add_js_data('filter_data', [ 'search_url' => route('web.products'), ]); $sortOptions = __('shop.sortby_options'); $sorttype = ($r = request()) ? $r->sorttype ?? 1 : 1; if (!is_array($sortOptions)) { $sortOptions = config('app.locale') == 'vi' ? [ '1' => 'Mới nhất', '2' => 'Tên (A-Z)', '3' => 'Tên (Z-A)', '4' => 'Giá (thấp - cao)', '5' => 'Giá (cao - thấp)', '6' => 'Ngẫu nhiên', '7' => 'Cũ nhất', ] : [ '1' => 'Newest', '2' => 'Product Name (A-Z)', '3' => 'Product Name (Z-A)', '4' => 'Price (lowest)', '5' => 'Price (Hightest)', '6' => 'Random', '7' => 'Oldest', ]; } $url = request()->getRequestUri(); $min = ($p = get_product(['@sorttype' => 4])) && $p->price_status ? $p->final_price : 0; $max = ($p = get_product(['@sorttype' => 5])) && $p->price_status ? $p->final_price : 99999999; @endphp