Skip to content

Home Page

URL: / Template: resources/views/template/home.blade.php

The homepage is the main landing page of the store. It typically displays featured products, new arrivals, promotional banners, and seasonal highlights.


Available Data

The homepage does not inject unique $page->misc properties beyond the standard global context. All data is fetched via helper functions.

Helper Returns Description
featureProducts(int $limit) array Featured/highlighted products
latestProducts() array Newest products (last 30 days)
discountedProducts(int $limit) array Products currently on sale
seasonsBestProduct(int $limit) array Most-ordered products recently
getVisitedProducts() array Recently viewed by the current logged-in user
getMenu('top') array Top navigation menu items
getCategory() object Category tree for navigation
getHomePageContent() array Homepage-specific content from admin

All product array structures are identical — see Product Object Structure for full field reference.


Theme Settings Used

$themes Key Description
$themes->banner_image Hero/banner image asset
$themes->header_image Logo image asset
$themes->homepage_meta_keyword Homepage-specific SEO keywords
$themes->homepage_meta_tag_description Homepage-specific SEO description

Minimal Homepage Template

@extends('layout.layout')

@section('headtitle')
    <title>{{ $page->settings->siteTitle ?? 'Welcome' }}</title>
@endsection

@section('headmeta')
    <meta name="keywords" content="{{ $themes->homepage_meta_keyword ?? $page->settings->metaKeywords ?? '' }}">
    <meta name="description" content="{{ $themes->homepage_meta_tag_description ?? $page->settings->metaDescription ?? '' }}">
@endsection

@section('content')
<div class="container-fluid px-0">

    {{-- Banner Image --}}
    @if(getPath($themes->banner_image ?? null))
        <div class="mb-4">
            <img src="{{ getPath($themes->banner_image) }}" class="img-fluid w-100" alt="Welcome Banner">
        </div>
    @endif

</div>

<div class="container mt-4">

    {{-- Featured Products --}}
    @php $featured = featureProducts(8); @endphp
    @if(count($featured))
        <section class="mb-5">
            <h2>Featured Products</h2>
            <div class="row">
                @foreach($featured as $product)
                    <div class="col-6 col-md-3 mb-4">
                        @include('partial.homepageproduct', compact('product'))
                    </div>
                @endforeach
            </div>
        </section>
    @endif

    {{-- Seasonal Best Sellers --}}
    @php $best = seasonsBestProduct(4); @endphp
    @if(count($best))
        <section class="mb-5">
            <h2>Season's Best</h2>
            <div class="row">
                @foreach($best as $product)
                    <div class="col-6 col-md-3 mb-4">
                        @include('partial.homepageproduct', compact('product'))
                    </div>
                @endforeach
            </div>
        </section>
    @endif

    {{-- New Arrivals --}}
    @php $latest = latestProducts(); @endphp
    @if(count($latest))
        <section class="mb-5">
            <h2>New Arrivals</h2>
            <div class="row">
                @foreach($latest as $product)
                    <div class="col-6 col-md-3 mb-4">
                        @include('partial.homepageproduct', compact('product'))
                    </div>
                @endforeach
            </div>
        </section>
    @endif

    {{-- Discounted Products --}}
    @php $onSale = discountedProducts(4); @endphp
    @if(count($onSale))
        <section class="mb-5">
            <h2>🔥 Special Offers</h2>
            <div class="row">
                @foreach($onSale as $product)
                    <div class="col-6 col-md-3 mb-4">
                        @include('partial.homepageproduct', compact('product'))
                    </div>
                @endforeach
            </div>
        </section>
    @endif

    {{-- Recently Viewed (logged-in users only) --}}
    @if(identity())
        @php $recentlyViewed = getVisitedProducts(); @endphp
        @if(count($recentlyViewed))
            <section class="mb-5">
                <h2>Recently Viewed</h2>
                <div class="row">
                    @foreach($recentlyViewed as $product)
                        <div class="col-6 col-md-3 mb-4">
                            @include('partial.homepageproduct', compact('product'))
                        </div>
                    @endforeach
                </div>
            </section>
        @endif
    @endif

</div>
@endsection

Catalog Mode

When $page->settings->catalogMode is 1, hide all add-to-cart buttons. The product card partial should check this:

{{-- In homepageproduct.blade.php --}}
@if(!$page->settings->catalogMode && ($product['availability'] ?? 0) > 0)
    <a href="{{ $product['addToCartUrl'] }}" class="btn btn-primary btn-sm">
        Add to Cart
    </a>
@else
    <a href="{{ $product['detailUrl'] }}" class="btn btn-outline-secondary btn-sm">
        View Details
    </a>
@endif