@php use Botble\Base\Facades\BaseHelper; // Pull root categories for the "Browse by Category" mega-list (nav-category-wrap). $headerCategories = collect(); if (is_plugin_active('ecommerce')) { $headerCategories = app(\Botble\Ecommerce\Repositories\Interfaces\ProductCategoryInterface::class) ->advancedGet([ 'condition' => ['parent_id' => 0, 'status' => 'published'], 'with' => ['slugable', 'activeChildren', 'activeChildren.activeChildren'], 'take' => 10, ]); } $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; // Per-preset overrides — demos for auto/electronics/mental diverge slightly: // auto: container + nav-category-wrap style-2 // electronics: container-full + nav-category-wrap (no style-2) + btn `gap-12` icon `fs-24` // mental: container + nav-category-wrap (no style-2) $innerContainer = trim((string) theme_option('header_inner_container', 'container')); $catModifier = trim((string) theme_option('header_category_modifier', 'style-2')); $catBtnGap = trim((string) theme_option('header_category_btn_gap', '')); $catBtnIconSize = trim((string) theme_option('header_category_btn_icon_size', '')); $extraLinkLabel = trim((string) theme_option('header_bottom_extra_link_label', '')); $extraLinkUrl = trim((string) theme_option('header_bottom_extra_link_url', '')); $extraLinkTarget = trim((string) theme_option('header_bottom_extra_link_target', '')); $offerText = trim((string) theme_option('header_bottom_offer_text', '')); $offerUrl = trim((string) theme_option('header_bottom_offer_url', '')); $offerTarget = trim((string) theme_option('header_bottom_offer_target', '')); $catWrapClasses = trim('nav-category-wrap ' . ($catModifier !== '' ? $catModifier . ' ' : '') . 'main-action-active'); $catBtnClasses = trim('btn-nav-drop btn-active text-nowrap' . ($catBtnGap !== '' ? ' ' . $catBtnGap : '')); $catBtnIconClass = trim('icon icon-List' . ($catBtnIconSize !== '' ? ' ' . $catBtnIconSize : '')); @endphp {{-- Header Style 7 — Logo + center search + actions; bottom bar adds category browser + main menu (header-s3 has-by-category). --}}
$hasEcommerceSearch]) @if ($hasEcommerceSearch) data-ajax-url="{{ $ajaxSearchUrl }}" @endif > {{-- AJAX-loaded category dropdown — mirrors Shofy theme pattern. Empty path. --}}
@if ($hasEcommerceSearch)
@endif
@include(Theme::getThemeNamespace('partials.header.ecommerce-action-buttons'), [ 'inlineSearchAtXl' => true, 'accountLabel' => theme_option('header_account_label', ''), ])
@include(Theme::getThemeNamespace('partials.header.browse-by-category'), [ 'categories' => $headerCategories, 'wrapClass' => $catWrapClasses, 'btnClass' => $catBtnClasses, 'btnIconClass' => $catBtnIconClass, ])
@if ($offerText !== '')
@if ($offerUrl !== '') {{ __($offerText) }} @else

{{ __($offerText) }}

@endif
@endif