@php
use Botble\Ecommerce\Facades\EcommerceHelper;
use Botble\Theme\Facades\Theme;
$shopLayout = Theme::get('shopLayout') ?: theme_option('ecommerce_shop_layout', 'default');
$themeFilterPosition = theme_option('default_filter_position', 'sidebar');
[$layoutSidebar, $containerClass, $filterPosition] = match ($shopLayout) {
'left-sidebar' => ['left', 'container', 'sidebar'],
'right-sidebar' => ['right', 'container', 'sidebar'],
'full-width' => ['none', 'container-full', 'drawer'],
'sub-collection' => [
$themeFilterPosition === 'sidebar' ? 'left' : 'none',
'container',
$themeFilterPosition === 'sidebar' ? 'sidebar' : 'drawer',
],
default => [
$themeFilterPosition === 'sidebar' ? 'left' : 'none',
'container',
$themeFilterPosition,
],
};
@endphp
@if (isset($category) || isset($tag) || isset($collection) || isset($brand))
@php $listingContext = $category ?? $tag ?? $collection ?? $brand ?? null; @endphp
@if ($listingContext)
@includeIf("plugins/ecommerce::themes.includes.product-listing-page-description", ["data" => $listingContext])
@endif
@endif
$layoutSidebar !== 'none',
'sidebar-' . $layoutSidebar => $layoutSidebar !== 'none',
'shop-layout-' . $shopLayout,
])
data-filter-position="{{ $filterPosition }}"
data-shop-layout="{{ $shopLayout }}"
>
{{-- Breadcrumb is rendered by layouts/base.blade.php. --}}
@if ($shopLayout === 'sub-collection')
@include(Theme::getThemeNamespace('views.ecommerce.includes.sub-collections-swiper'), [
'parentCategory' => $category ?? null,
])
@endif
@if ($layoutSidebar === 'left')
@endif
$layoutSidebar === 'right',
])>
@if ($filterPosition === 'dropdown')
@include(Theme::getThemeNamespace('views.ecommerce.includes.filters-dropdown'))
@endif
@include(Theme::getThemeNamespace('views.ecommerce.includes.product-filters-top'))
@include(Theme::getThemeNamespace('views.ecommerce.includes.products-listing'), ['products' => $products])
@if ($layoutSidebar === 'right')
@endif
@if ($filterPosition === 'drawer')
@include(Theme::getThemeNamespace('views.ecommerce.includes.filters-drawer'))
@endif