{{-- Shared store footer. Only renders content configured in the admin footer settings. --}} @php $storeLocale = $currentLocale ?? app()->getLocale(); $storeLocalized = static function ($value, $fallback = '') use ($storeLocale) { if (is_array($value)) { return $value[$storeLocale] ?? $value['en'] ?? reset($value) ?? $fallback; } return $value ?: $fallback; }; $storeFooter = $footerData ?? app(\App\Domain\AppBase\Actions\Home\FetchHomeDataAction::class)->getStoreFooterData() ?? []; $storeFooterLogo = data_get($storeFooter, 'logo'); $storeDescription = $storeLocalized(data_get($storeFooter, 'description'), ''); $storeSocialLinks = data_get($storeFooter, 'social', []); $hasStoreSocialLinks = collect($storeSocialLinks)->contains(fn ($url) => filled($url)); $storeTermsUrl = data_get($storeFooter, 'links.terms'); $storePrivacyUrl = data_get($storeFooter, 'links.privacy'); $contactLink = data_get($storeFooter, 'links.contact'); $copyrightText = $storeLocalized( $storeFooter['copyright'] ?? null, '' ); $copyrightText = preg_replace('/\s*©\s*(?:[0-9٠-٩]{4}\s*)?/u', ' ', (string) $copyrightText); $copyrightText = preg_replace('/^\s*[0-9٠-٩]{4}\s*/u', '', $copyrightText); $copyrightText = trim($copyrightText); $hasFooterContent = filled($storeFooterLogo) || filled($storeDescription) || $hasStoreSocialLinks || filled($storeTermsUrl) || filled($storePrivacyUrl) || filled($contactLink) || filled($copyrightText); $hasFooterBrandContent = filled($storeFooterLogo) || filled($storeDescription); $hasFooterLinks = filled($storeTermsUrl) || filled($storePrivacyUrl) || filled($contactLink); $socialIcons = [ 'facebook' => 'facebook', 'twitter' => 'twitter', 'instagram' => 'instagram', 'linkedin' => 'linkedin', 'youtube' => 'youtube', 'whatsapp' => 'whatsapp', ]; @endphp @if($hasFooterContent) @endif @include('ecommerce::partials.legal-content-modals')