@php // Search popular keywords (CSV). Empty = hide the keywords block. $rawKeywords = (string) theme_option('search_popular_keywords'); $keywords = array_values(array_filter(array_map('trim', explode(',', $rawKeywords)))); // Live AJAX autocomplete uses the ecommerce plugin's bb-form-quick-search machinery // (debounced keyup → public.ajax.search-products → renders includes.ajax-search-results). // Falls back to a plain GET form when ecommerce is not active. $hasEcommerceSearch = is_plugin_active('ecommerce') && \Illuminate\Support\Facades\Route::has('public.products') && \Illuminate\Support\Facades\Route::has('public.ajax.search-products'); $searchAction = $hasEcommerceSearch ? route('public.products') : url('/search'); $ajaxSearchUrl = $hasEcommerceSearch ? route('public.ajax.search-products') : null; @endphp