@if (setting('EXTRA_CAT_PRODUCT_STATUS') != 0 || setting('EXTRA_CAT_PRODUCT_STATUS') == '')
@if (!empty(setting('extra_cat')))
    @foreach (json_decode(setting('extra_cat')) as $c)
        @php
            $cat = DB::table('extra_mini_categories')->where('id', $c)->first();
            $productIds = DB::table('extra_mini_category_product')
                ->where('extra_mini_category_id', $c)
                ->get()
                ->pluck('product_id');
            $products = \App\Models\Product::whereIn('id', $productIds)->where('status', 1)->take(6)->get();
        @endphp
        @if ($cat)
            @if ($products->count() > 0)
                <div class="products">
                    <div class="container">
                        <h3 class="title"><span>{{ $cat->name }}</span> <a
                                href="{{ route('extraCategory.product', $cat->slug) }}">View
                                All</a></h3>
                        <div class="row autoplay slick-slides">
                            @forelse ($products as $product)
                                <x-product-grid-view :product="$product" classes="" />
                            @empty
                                <x-product-empty-component />
                            @endforelse

                        </div>
                    </div>
                </div>
            @endif
        @endif
    @endforeach
@endif
@endif