{{-- Newsletter --}}
Newsletter
{{ \App\Models\SiteSetting::getValue('footer_newsletter_text') ?: 'Jadilah yang pertama mendengar tentang produk baru, acara eksklusif, dan penawaran online.' }}
{{-- Column 1 — About Us / Custom Links --}}
@php
$col1Title = \App\Models\SiteSetting::getValue('footer_col1_title') ?: 'About Us';
$col1Raw = \App\Models\SiteSetting::getValue('footer_col1_links');
$col1Items = [];
if ($col1Raw !== null) {
if (trim($col1Raw) !== '') {
foreach (preg_split("/\r?\n/", $col1Raw) as $line) {
$line = trim($line);
if ($line === '') continue;
[$title, $url] = array_pad(array_map('trim', explode('|', $line, 2)), 2, '');
if ($title !== '') {
$col1Items[] = ['title' => $title, 'url' => $url ?: '#'];
}
}
}
} else {
$col1Items = [
['title' => 'About Us', 'url' => '/about-us'],
['title' => 'Contact Us', 'url' => '/contact-us'],
['title' => 'Customer Service', 'url' => '/customer-service'],
['title' => 'What\'s New', 'url' => '/whats-new'],
['title' => 'Terms & Conditions', 'url' => '/page/terms-conditions'],
];
}
@endphp
@if(!empty($col1Items))
@endif
{{-- Column 2 — Privacy Policy / Custom Links --}}
@php
$col2Title = \App\Models\SiteSetting::getValue('footer_col2_title') ?: 'Privacy Policy';
$col2Raw = \App\Models\SiteSetting::getValue('footer_col2_links');
$col2Items = [];
if ($col2Raw !== null) {
if (trim($col2Raw) !== '') {
foreach (preg_split("/\r?\n/", $col2Raw) as $line) {
$line = trim($line);
if ($line === '') continue;
[$title, $url] = array_pad(array_map('trim', explode('|', $line, 2)), 2, '');
if ($title !== '') {
$col2Items[] = ['title' => $title, 'url' => $url ?: '#'];
}
}
}
} else {
$col2Items = [
['title' => 'Payment Policy', 'url' => '/page/payment-policy'],
['title' => 'Shipping Policy', 'url' => '/page/shipping-policy'],
['title' => 'Refund Policy', 'url' => '/page/refund-policy'],
['title' => 'Return Policy', 'url' => '/page/return-policy'],
['title' => 'FAQ', 'url' => '/faq'],
];
}
@endphp
@if(!empty($col2Items))
@endif
{{-- Column 3 — Contact Details --}}
@if (! empty($footerOptions['column_3']))
@php
usort($footerOptions['column_3'], fn($a, $b) => ($a['sort_order'] ?? 0) - ($b['sort_order'] ?? 0));
$col3Header = $footerOptions['column_3'][0]['title'] ?? 'Detail Kontak';
$col3Links = array_slice($footerOptions['column_3'], 1);
@endphp
{{ $col3Header }}
@foreach ($col3Links as $link)
@php $url = $link['url'] ?? ''; @endphp
@if (str_starts_with($url, 'mailto:'))
@elseif (str_starts_with($url, 'tel:'))
@else
{!! nl2br(e($link['title'])) !!}
@endif
@endforeach
@else
@php
$storeAddress = (string) core()->getConfigData('beres_storefront.contact.address') ?: \App\Models\SiteSetting::getValue('store_address');
$storePhone = (string) core()->getConfigData('beres_storefront.contact.phone')
?: ((string) core()->getConfigData('beres_storefront.contact.whatsapp_number')
?: (\App\Models\SiteSetting::getValue('store_phone') ?: \App\Models\SiteSetting::getValue('store_whatsapp')));
$storeEmail = (string) core()->getConfigData('beres_storefront.contact.email') ?: \App\Models\SiteSetting::getValue('store_email');
@endphp
@if($storeAddress || $storePhone || $storeEmail)
DETAIL KONTAK
© {{ date('Y') }} {{ $siteName }}
@if($storeAddress)
{!! nl2br(e($storeAddress)) !!}
@endif
@if($storePhone)
@endif
@if($storeEmail)
@endif
@endif
@endif
{{-- Column 4 — Social Media --}}
@if (! empty($footerOptions['column_4']))
@php
usort($footerOptions['column_4'], fn($a, $b) => ($a['sort_order'] ?? 0) - ($b['sort_order'] ?? 0));
$col4Header = $footerOptions['column_4'][0]['title'] ?? 'Ikuti kami';
$col4Links = array_slice($footerOptions['column_4'], 1);
@endphp
{{ $col4Header }}
@foreach ($col4Links as $link)
@php
$url = $link['url'] ?? '';
$icon = null;
foreach ($socialIcons as $provider => $svg) {
if (str_contains(strtolower($url), $provider)) {
$icon = $svg;
break;
}
}
@endphp
@if ($icon)
{!! $icon !!}
@else
{{ $link['title'] }}
@endif
@endforeach
@else
@php
$storeIg = \App\Models\SiteSetting::getValue('store_instagram');
$storeFb = \App\Models\SiteSetting::getValue('store_facebook');
$storeYt = \App\Models\SiteSetting::getValue('store_youtube');
$storeTt = \App\Models\SiteSetting::getValue('store_tiktok');
$storeWa = (string) core()->getConfigData('beres_storefront.contact.whatsapp_number') ?: \App\Models\SiteSetting::getValue('store_whatsapp');
$hasSocial = $storeIg || $storeFb || $storeYt || $storeTt || $storeWa;
@endphp
@if($hasSocial)
@endif
@endif