@php if (app()->getLocale() === 'en' && !session()->has('locale')) { $effectiveLocale = \Illuminate\Support\Facades\Cache::get('frontend_default_locale') ?: (\Illuminate\Support\Facades\Schema::hasTable('languages') ? \App\Models\Language::where('is_default', true)->value('code') : null) ?: 'tr'; app()->setLocale($effectiveLocale); \Carbon\Carbon::setLocale($effectiveLocale); } @endphp @php $userAg = (string) request()->userAgent(); $isMobileAppWebView = str_contains($userAg, 'FitnessApp') || str_contains($userAg, 'WiseTicaretApp') || str_contains($userAg, 'MobileApp'); $mobileAppModuleActive = file_exists(base_path('Plugins/MobileApp/plugin.json')) && app(\App\Services\PluginManager::class)->isActive('MobileApp'); $smartBannerSetting = \App\Models\Store::getSetting('mobile_app_smart_banner_enabled'); $isSmartBannerActive = $mobileAppModuleActive && ($smartBannerSetting === '1' || $smartBannerSetting === 1 || $smartBannerSetting === true || $smartBannerSetting === 'true'); $iosAppId = null; if ($isSmartBannerActive) { $iosAppInput = \App\Models\Store::getSetting('mobile_app_ios_id') ?: \App\Models\Store::getSetting('ios_app_id'); if ($iosAppInput) { if (preg_match('/id(\d+)/', (string) $iosAppInput, $matches)) { $iosAppId = $matches[1]; } elseif (preg_match('/^\d+$/', trim((string) $iosAppInput))) { $iosAppId = trim((string) $iosAppInput); } } if (!$iosAppId) { $appStoreUrl = \App\Models\Store::getSetting('mobile_app_app_store_url'); if ($appStoreUrl && preg_match('/id(\d+)/', (string) $appStoreUrl, $idMatches)) { $iosAppId = $idMatches[1]; } else { $rawFooterApps = \App\Models\Store::getSetting('theme_footer_mobile_app_links'); $parsedFooterApps = is_array($rawFooterApps) ? $rawFooterApps : ($rawFooterApps ? json_decode($rawFooterApps, true) : []); $appStoreConfig = collect($parsedFooterApps)->firstWhere('platform', 'app_store'); if (!empty($appStoreConfig['url']) && preg_match('/id(\d+)/', (string) $appStoreConfig['url'], $idMatches)) { $iosAppId = $idMatches[1]; } } } } @endphp @if($isSmartBannerActive && !empty($iosAppId) && !$isMobileAppWebView) @endif @php $activeStores = $activeStores ?? collect(); $currentActiveStore = $currentActiveStore ?? $activeStores->first(); $currentStoreSettings = $currentStoreSettings ?? (is_array($currentActiveStore->settings ?? null) ? $currentActiveStore->settings : []); $siteName = \App\Models\Store::getSetting('site_name') ?: config('app.name', 'WiseTicaret'); $siteTitle = \App\Models\Store::getSetting('site_title') ?: $siteName; $metaTags = \App\Models\Store::getSetting('meta_tags') ?? ''; $metaDesc = \App\Models\Store::getSetting('meta_description') ?? ''; $ogImage = \App\Models\Store::getSetting('og_image') ?? ''; $changeTitleOnBlur = \App\Models\Store::getSetting('change_title_on_blur') === '1'; $blurTitle = \App\Models\Store::getSetting('blur_title'); $isHomePage = request()->is('/') || request()->routeIs('home'); if ($isHomePage) { $computedTitle = $siteTitle; $computedMetaDesc = $metaDesc; } else { $rawYieldTitle = trim($__env->yieldContent('title')); if ($rawYieldTitle && !in_array(mb_strtolower($rawYieldTitle), ['anasayfa', mb_strtolower(__('default.home_title'))], true)) { if (str_contains(mb_strtolower($rawYieldTitle), mb_strtolower($siteName))) { $computedTitle = $rawYieldTitle; } else { $computedTitle = $rawYieldTitle . ' - ' . $siteName; } } else { $computedTitle = $siteTitle; } $rawYieldMetaDesc = trim($__env->yieldContent('meta_description')); $computedMetaDesc = $rawYieldMetaDesc ?: $metaDesc; } $computedTitle = html_entity_decode(html_entity_decode($computedTitle, ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8'); $computedMetaDesc = html_entity_decode(html_entity_decode(trim(preg_replace('/\s+/', ' ', strip_tags($computedMetaDesc))), ENT_QUOTES | ENT_HTML5, 'UTF-8'), ENT_QUOTES | ENT_HTML5, 'UTF-8'); $footerSocialStr = \App\Models\Store::getSetting('theme_footer_social_links'); $footerSocialsData = is_array($footerSocialStr) ? $footerSocialStr : ($footerSocialStr ? json_decode($footerSocialStr, true) : []); $sameAsLinks = []; foreach($footerSocialsData as $soc) { if(!empty($soc['enabled']) && !empty($soc['url']) && $soc['url'] !== '#') { $sameAsLinks[] = $soc['url']; } } $contactPhone = \App\Models\Store::getSetting('contact_phone') ?: ''; $contactAddress = \App\Models\Store::getSetting('contact_address') ?: ''; $storeLogo = \App\Models\Store::getSetting('theme_header_logo') ?: $ogImage; $schemaGraph = [ [ '@type' => 'WebSite', '@id' => url('/') . '/#website', 'url' => url('/'), 'name' => $siteName, 'description' => $metaDesc, 'potentialAction' => [ '@type' => 'SearchAction', 'target' => url('/kategori') . '?search={search_term_string}', 'query-input' => 'required name=search_term_string' ] ], array_filter([ '@type' => 'OnlineStore', '@id' => url('/') . '/#organization', 'name' => $siteName, 'url' => url('/'), 'logo' => $storeLogo ? asset($storeLogo) : null, 'image' => $storeLogo ? asset($storeLogo) : null, 'telephone' => $contactPhone, 'address' => [ '@type' => 'PostalAddress', 'streetAddress' => $contactAddress, 'addressLocality' => 'Karşıyaka', 'addressRegion' => 'İzmir', 'addressCountry' => 'TR' ], 'sameAs' => count($sameAsLinks) > 0 ? array_values($sameAsLinks) : null ]) ]; $schemaJson = json_encode(['@context' => 'https://schema.org', '@graph' => $schemaGraph], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); @endphp {!! $computedTitle !!} @if(request()->routeIs('home', 'category', 'product', 'page') && !$isMobileAppWebView) @endif @php $cleanCanonicalUrl = preg_replace('/\/public(\/|$)/', '/', url()->current()); @endphp @hasSection('meta') @yield('meta') @else @if($computedMetaDesc) @endif @if($metaTags) @endif @if($ogImage) @endif @endif @if($changeTitleOnBlur && $blurTitle) @endif @php if (file_exists(public_path('hot'))) { @unlink(public_path('hot')); } $themeCssFile = null; $themeJsFile = null; $manifestPath = public_path('build/manifest.json'); if (file_exists($manifestPath)) { $manifestData = json_decode(@file_get_contents($manifestPath), true); $themeCssFile = $manifestData['Themes/default/assets/css/theme.css']['file'] ?? null; $themeJsFile = $manifestData['Themes/default/assets/js/theme.js']['file'] ?? null; } @endphp @if($themeCssFile) @else @vite(['Themes/default/assets/css/theme.css']) @endif @if($themeJsFile) @else @vite(['Themes/default/assets/js/theme.js']) @endif @php $faviconUrl = \App\Models\Store::getFaviconUrl(); $faviconMime = \App\Models\Store::getFaviconMime(); @endphp @php $primaryColor = \App\Models\Store::getSetting('theme_primary_color') ?? '#ff6b00'; $topHeaderBg = \App\Models\Store::getSetting('theme_top_header_bg') ?? '#000000'; $topHeaderTextColor = \App\Models\Store::getSetting('theme_topheader_text_color') ?? '#ffffff'; $topHeaderBorderColor = \App\Models\Store::getSetting('theme_topheader_border_color') ?? '#222222'; $topHeaderAnnounceColor = \App\Models\Store::getSetting('theme_topheader_announcement_color') ?? '#ff6b00'; $topHeaderAnnounceText = \App\Models\Store::getSetting('theme_topheader_announcement_text') ?? ''; $topHeaderAnnounceUrl = \App\Models\Store::getSetting('theme_topheader_announcement_url') ?? ''; $topHeaderAnnounceNewTab = \App\Models\Store::getSetting('theme_topheader_announcement_new_tab') == '1'; $bodyFont = \App\Models\Store::getSetting('theme_body_font') ?? 'Inter'; $headingFont = \App\Models\Store::getSetting('theme_heading_font') ?? 'Oswald'; $siteWidth = \App\Models\Store::getSetting('theme_site_width') ?? '1400'; $headerSearchBorderRadius = \App\Models\Store::getSetting('theme_header_search_border_radius') ?? '8'; $headerSearchPlaceholder = \App\Models\Store::getSetting('theme_header_search_placeholder') ?: __('default.search_placeholder'); $headerLogoSize = $currentStoreSettings['theme_header_logo_size'] ?? '40'; $headerLogoSize = is_numeric($headerLogoSize) ? max(20, min(150, (int) $headerLogoSize)) : 40; $footerLogoSize = \App\Models\Store::getSetting('theme_footer_logo_size') ?? '60'; $scrollTopEnabled = \App\Models\Store::getSetting('scroll_top_button') ?? '0'; $scrollTopBg = \App\Models\Store::getSetting('scroll_top_bg_color') ?? '#000000'; $scrollTopIconColor = \App\Models\Store::getSetting('scroll_top_icon_color') ?? '#ffffff'; $scrollTopMargin = \App\Models\Store::getSetting('scroll_top_margin') ?? '50'; $scrollTopRadius = \App\Models\Store::getSetting('scroll_top_radius') ?? '0'; @endphp @if($isMobileAppWebView) @php $mobileAppCss = (string) ($currentStoreSettings['mobile_app_css'] ?? ''); @endphp @if(trim($mobileAppCss) !== '') {{-- Mobil panelden kaydedilen CSS yalnızca Android/iOS uygulama WebView'ında çalışır. --}} @endif @endif @php $isMaintenanceActive = ((\App\Models\Store::getSetting('maintenance_enabled') ?? \App\Models\Setting::where('key', 'maintenance_enabled')->value('value')) === '1'); @endphp @if($isMaintenanceActive)
Bakım Modu Aktif - Ziyaretçiler mağazaya erişemiyor @php $adminMaintenanceUrl = url(trim(\App\Models\Setting::where('key', 'admin_panel_path')->value('value') ?: 'wisesoft', '/') . '/settings/maintenance'); @endphp Ayarları Yönet →
@endif @if(session()->has('impersonator_id'))
Şu an {{ Auth::user()->name }} ({{ Auth::user()->email }}) üye hesabı olarak oturum açtınız.
Yönetici Paneline Geri Dön →
@endif @include('theme::partials.topheader-announcement') @php $topHeaderEnabled = \App\Models\Store::getSetting('theme_topheader_enabled') ?? '1'; @endphp @if($topHeaderEnabled == '1')
@php $leftHtml = \App\Models\Store::getSetting('theme_topheader_left_html'); $rightMenuStr = \App\Models\Store::getSetting('theme_topheader_right_menu'); $rightMenu = is_array($rightMenuStr) ? $rightMenuStr : ($rightMenuStr ? json_decode($rightMenuStr, true) : []); $announceIcon = \App\Models\Store::getSetting('theme_topheader_announcement_icon'); $announceIconKebab = $announceIcon ? strtolower(preg_replace('/(? @if($topHeaderAnnounceText) @if($topHeaderAnnounceUrl) @if($announceIconKebab) @endif {{ $topHeaderAnnounceText }} @else @if($announceIconKebab) @endif {{ $topHeaderAnnounceText }} @endif @elseif($leftHtml) {!! $leftHtml !!} @else {{ $shippingPolicy['free_shipping_banner'] ?? __('default.free_shipping_banner') }} @endif
@endif @php $activeBarColor = $currentActiveStore ? ($currentActiveStore->theme_color ?? '#ff6b00') : '#ff6b00'; @endphp @if($activeStores->count() > 1) @endif
@php $headerLogo = null; if ($currentActiveStore && is_array($currentActiveStore->settings ?? null)) { $headerLogo = $currentActiveStore->settings['theme_header_logo'] ?? null; } $headerLogo = $headerLogo ?: ($currentActiveStore->logo ?? null); $headerLogoUrl = $headerLogo ? ((str_starts_with($headerLogo, 'http://') || str_starts_with($headerLogo, 'https://') || str_starts_with($headerLogo, '/')) ? $headerLogo : asset($headerLogo)) : null; @endphp @if($headerLogoUrl) @else WISEMARKET @endif
@php $suggestedTermsStr = \App\Models\Store::getSetting('theme_header_search_suggested_terms'); $suggestedTerms = $suggestedTermsStr ? array_map('trim', explode(',', $suggestedTermsStr)) : []; @endphp
@auth @if(Auth::user()->membership_type === 'b2b') @php $b2bStores = Auth::user()->dealerStores()->wherePivot('status', 'approved')->get(); $activeB2bStoreId = app()->bound('activeStore') ? app('activeStore')->id : null; $walletBalance = Auth::user()->wallet_balance; @endphp @if($b2bStores->count() > 1) @endif @endif
@if(Auth::user()->hasActivePremium()) @endif
@else @php $registrationEnabled = \App\Models\Store::getSetting('registration_enabled', '1') !== '0'; @endphp
@endauth @php $notificationsEnabled = \App\Models\Store::getSetting('theme_header_notifications_enabled') ?? '1'; $notificationsShowTitle = \App\Models\Store::getSetting('theme_header_notifications_show_title') ?? '1'; $favoritesEnabled = \App\Models\Store::getSetting('theme_header_favorites_enabled') ?? '1'; $favoritesShowTitle = \App\Models\Store::getSetting('theme_header_favorites_show_title') ?? '1'; $adminPanelEnabled = \App\Models\Store::getSetting('theme_header_admin_panel_enabled') ?? '1'; $adminPanelShowTitle = \App\Models\Store::getSetting('theme_header_admin_panel_show_title') ?? '1'; $cartEnabled = \App\Models\Store::getSetting('theme_header_cart_enabled') ?? '1'; $cartShowTitle = \App\Models\Store::getSetting('theme_header_cart_show_title') ?? '1'; $canAccessAdminPanel = Auth::check() && (Auth::user()->role === 'admin' || Auth::user()->admin_group_id !== null); @endphp @if($adminPanelEnabled == '1' && $canAccessAdminPanel)
@if($adminPanelShowTitle == '1') @endif
@endif @auth @if($notificationsEnabled == '1') @endif @endauth @if($favoritesEnabled == '1')
{{ count($userFavorites ?? []) }}
@if($favoritesShowTitle == '1') @endif
@endif @if($cartEnabled == '1') @php $headerCartStoreId = $currentActiveStore->id ?? session('active_store_id', 1); $headerCart = session('cart_' . $headerCartStoreId, []); $cartCount = array_sum(array_column($headerCart, 'quantity')); $cartTotal = array_sum(array_map(function($item) { return $item['price'] * $item['quantity']; }, $headerCart)); @endphp
{{ $cartCount }}
@if($cartShowTitle == '1') @endif
@endif

{{ __('default.categories') ?? 'Kategoriler' }}

@php $msbPluginManager = app(\App\Services\PluginManager::class); $msbB2bActive = $msbPluginManager->isActive('BayiB2B') && file_exists(base_path('Plugins/BayiB2B')); $msbGoogleLogin = file_exists(base_path('Plugins/GoogleLogin/plugin.json')) && $msbPluginManager->isActive('GoogleLogin') && \App\Models\Setting::where('key','google_login_enabled')->value('value') === '1' && filled(\App\Models\Setting::where('key','google_client_id')->value('value')) && filled(\App\Models\Setting::where('key','google_client_secret')->value('value')); $msbAppleLogin = file_exists(base_path('Plugins/AppleLogin/plugin.json')) && $msbPluginManager->isActive('AppleLogin') && \App\Models\Setting::where('key','apple_login_enabled')->value('value') === '1' && collect(['apple_client_id', 'apple_team_id', 'apple_key_id', 'apple_private_key']) ->every(fn($key) => filled(\App\Models\Setting::where('key', $key)->value('value'))); @endphp
@auth
{{ mb_strtoupper(mb_substr(Auth::user()->name ?? 'U', 0, 1)) }}
{{ Auth::user()->name }}
{{ Auth::user()->email }}
Hesabım @if($msbB2bActive && (Auth::user()->membership_type === 'b2b' || Auth::user()->role === 'reseller')) Bayi Paneli @else Siparişlerim @endif
@else
{{ __('default.login') ?? 'Giriş Yap' }} @if(\App\Models\Setting::where('key', 'registration_enabled')->value('value') !== '0') {{ __('default.register') ?? 'Kayıt Ol' }} @endif
@if($msbGoogleLogin || $msbAppleLogin)
@if($msbGoogleLogin) Google Google @endif @if($msbAppleLogin) Apple @endif
@endif @if($msbB2bActive) @endif @endauth
@if($fixedMenuEnabled)
{{ $fixedMenuName }}
@endif
@php $rightCartSidebarEnabled = \App\Models\Store::getSetting('cart_right_sidebar_enabled', '0') === '1' && !request()->routeIs('cart', 'checkout', 'checkout.*'); @endphp @if($rightCartSidebarEnabled) @endif
@yield('content')
@auth @endauth @if(isset($scrollTopEnabled) && $scrollTopEnabled == '1') @endif @if(session('error'))

Hata!

{{ session('error') }}

@endif @if(session('success')) @endif @auth @endauth @include('partials.cookie-consent') @stack('scripts') @php $wiseAiPluginActive = \Illuminate\Support\Facades\File::exists(base_path('Plugins/WiseAi')) && app(\App\Services\PluginManager::class)->isActive('WiseAi'); $wiseAiActiveSetting = \App\Models\Store::getSetting('ai_assistant_active'); if ($wiseAiActiveSetting === null) { $wiseAiActiveSetting = \App\Models\Setting::getValue('ai_assistant_active', '1'); } $wiseAiEnabled = $wiseAiPluginActive && !in_array($wiseAiActiveSetting, [0, '0', false, 'false'], true); $wiseAiName = \App\Models\Store::getSetting('ai_assistant_name') ?: 'Wise AI'; $wiseAiImage = \App\Models\Store::getSetting('ai_widget_image'); @endphp @if($wiseAiEnabled)
@else @endif @php $megaStoreId = isset($currentActiveStore) && $currentActiveStore ? $currentActiveStore->id : (app()->bound('activeStore') && app('activeStore') ? app('activeStore')->id : 1); $megaRootCats = \App\Models\Category::query() ->when($megaStoreId, function($q) use ($megaStoreId) { $q->where(function($sq) use ($megaStoreId) { $sq->where('store_id', $megaStoreId)->orWhereNull('store_id')->orWhere('store_id', 0); }); }) ->where(function($q) { $q->where('is_active', true)->orWhere('is_active', 1)->orWhereNull('is_active'); }) ->where(function($q) { $q->whereNull('parent_id')->orWhere('parent_id', 0); }) ->withCount(['children as active_children_count' => function ($q) { $q->where(function ($q) { $q->where('is_active', true)->orWhere('is_active', 1)->orWhereNull('is_active'); }); }]) ->orderBy('order') ->orderBy('name') ->get(); $megaPreloadedRoot = $megaRootCats->map(function($cat) { $childrenCount = (int) $cat->active_children_count; $hasChildren = $childrenCount > 0; $imageUrl = null; if (!empty($cat->image)) { $cleanImg = ltrim($cat->image, '/'); if (preg_match('/^https?:\/\//i', $cleanImg)) { $imageUrl = $cleanImg; } elseif (str_starts_with($cleanImg, 'uploads/')) { $imageUrl = asset($cleanImg); } elseif (str_starts_with($cleanImg, 'storage/app/public/')) { $imageUrl = asset('storage/' . substr($cleanImg, strlen('storage/app/public/'))); } elseif (file_exists(public_path('uploads/categories/' . basename($cleanImg)))) { $imageUrl = asset('uploads/categories/' . basename($cleanImg)); } else { $imageUrl = asset('storage/categories/' . basename($cleanImg)); } } return [ 'id' => (int) $cat->id, 'name' => (string) $cat->name, 'slug' => (string) $cat->slug, 'image' => $imageUrl, 'icon' => $cat->icon ?: null, 'has_children' => (bool) $hasChildren, 'children_count' => (int) $childrenCount, 'url' => route('category', ['slug' => $cat->slug]), ]; }); @endphp @if(file_exists(base_path('Plugins/Scratchcard/plugin.json')) && app(\App\Services\PluginManager::class)->isActive('Scratchcard')) @include('components.scratchcard') @endif @if(file_exists(base_path('Plugins/WheelOfFortune/plugin.json')) && app(\App\Services\PluginManager::class)->isActive('WheelOfFortune')) @include('components.wheel-of-fortune') @endif @include('theme::partials.modal-announcement') @include('theme::partials.passkey-prompt') @if(file_exists(base_path('Plugins/MobileApp/plugin.json')) && app(\App\Services\PluginManager::class)->isActive('MobileApp')) @php $mobilePushUserPayload = auth()->check() ? [ 'authenticated' => true, 'user_id' => auth()->id(), 'user_signature' => hash_hmac('sha256', (string) auth()->id(), (string) config('app.key')), ] : ['authenticated' => false]; @endphp @endif