@php $controller = app( \App\Modules\Catalog\Http\Controllers\PublicCatalogController::class ); /* * Automatic Font Awesome category icon. * Thumbnail always has priority. */ $categoryIcon = function ( string $name ) { $name = \Illuminate\Support\Str::lower( $name ); if ( \Illuminate\Support\Str::contains( $name, [ 'ring', 'rings', ] ) ) { return 'fa-ring'; } if ( \Illuminate\Support\Str::contains( $name, [ 'diamond', 'jewel', 'gem', 'earring', 'necklace', 'pendant', ] ) ) { return 'fa-gem'; } if ( \Illuminate\Support\Str::contains( $name, [ 'bracelet', 'bangle', 'watch', ] ) ) { return 'fa-clock'; } if ( \Illuminate\Support\Str::contains( $name, [ 'fashion', 'shirt', 'dress', 'clothes', 'apparel', ] ) ) { return 'fa-shirt'; } if ( \Illuminate\Support\Str::contains( $name, [ 'shoe', 'footwear', ] ) ) { return 'fa-shoe-prints'; } if ( \Illuminate\Support\Str::contains( $name, [ 'mobile', 'phone', ] ) ) { return 'fa-mobile-screen-button'; } if ( \Illuminate\Support\Str::contains( $name, [ 'laptop', 'computer', 'electronics', ] ) ) { return 'fa-laptop'; } if ( \Illuminate\Support\Str::contains( $name, [ 'cake', 'bakery', ] ) ) { return 'fa-cake-candles'; } if ( \Illuminate\Support\Str::contains( $name, [ 'food', 'restaurant', ] ) ) { return 'fa-utensils'; } if ( \Illuminate\Support\Str::contains( $name, [ 'bag', 'purse', ] ) ) { return 'fa-bag-shopping'; } if ( \Illuminate\Support\Str::contains( $name, [ 'glass', 'eyewear', ] ) ) { return 'fa-glasses'; } if ( \Illuminate\Support\Str::contains( $name, [ 'beauty', 'cosmetic', 'perfume', ] ) ) { return 'fa-spray-can-sparkles'; } return 'fa-folder'; }; $currentUrl = request()->fullUrl(); $isRootCatalog = $currentCategory === null; $folderSectionTitle = $isRootCatalog ? 'Collections' : 'Subcategories'; $folderSectionSubtitle = $isRootCatalog ? 'Select a collection to continue' : 'Select a subcategory to view products'; @endphp
{{ $settings->title }}
{{ $settings->subtitle ?: 'Browse our collection' }}
@if($isRootCatalog) {{ $settings->business_type === 'jewellery' ? 'Jewellery Collection' : 'Product Collection' }} @elseif( $mode === 'folders' ) Collection @else Products @endif

@if($isRootCatalog) {{ $settings->title }} @else {{ $pageTitle }} @endif

@if($isRootCatalog) {{ $settings->subtitle ?: 'Explore our latest collections' }} @else {{ $pageSubtitle }} @endif

@if(count($breadcrumbs)) @endif @if( $mode === 'folders' )
Browse

{{ $folderSectionTitle }}

{{ $folderSectionSubtitle }}
{{ $folders->count() }} folder(s)
@if($folders->count())
@foreach( $folders as $folder ) @endforeach
@else
No categories available.
@endif @endif @if( $mode === 'products' )
Collection

{{ $pageTitle }}

{{ $pageSubtitle }}
{{ $products ? $products->total() : 0 }} product(s)
@if( $products && $products->count() )
@foreach( $products as $product ) @php $image = $controller ->imageUrl( $product ); $attrs = is_array( $product ->attributes_json ) ? $product ->attributes_json : []; $priceOnRequest = (bool) ( $attrs[ 'price_on_request' ] ?? false ); $hasSale = $product ->sale_price !== null && (float) $product ->sale_price < (float) $product ->regular_price; $price = $hasSale ? $product ->sale_price : $product ->regular_price; $currency = strtoupper( $product->currency ?: 'INR' ); $priceText = $currency === 'INR' ? '₹'.number_format( (float) $price, 2 ) : $currency .' ' .number_format( (float) $price, 2 ); $productUrl = route( 'public.catalog.product', [ 'slug' => $settings->slug, 'productSlug' => $product->slug, ] ); $waNumber = preg_replace( '/[^0-9]/', '', (string) ( $attrs[ 'whatsapp_number' ] ?? $settings ->whatsapp_number ?? '' ) ); $waText = "Hi, I am interested in:\n\n" .$product->name; if ($product->sku) { $waText .= "\nSKU: " .$product->sku; } if ($priceOnRequest) { $waText .= "\nPrice: Please share current price."; } else { $waText .= "\nPrice: " .$priceText; } $waText .= "\n\nProduct Link: " .$productUrl; $waUrl = $waNumber !== '' ? 'https://wa.me/' .$waNumber .'?text=' .rawurlencode( $waText ) : null; @endphp
@if($image) {{ $product->name }} @else
@endif
@if( $product->category ) @if( $product ->category ->parent ) {{ $product ->category ->parent ->name }} / @endif {{ $product ->category ->name }} @endif
{{ $product->name }}
@if( $settings->show_sku && $product->sku )
SKU: {{ $product->sku }}
@endif
{{ $priceOnRequest ? 'Price on Request' : $priceText }}
@if( !empty( $attrs[ 'metal_type' ] ) ) {{ $attrs[ 'metal_type' ] }} @endif @if( !empty( $attrs[ 'purity' ] ) ) {{ $attrs[ 'purity' ] }} @endif @if( !empty( $attrs[ 'gross_weight_g' ] ) ) {{ $attrs[ 'gross_weight_g' ] }} g @endif
@endforeach
@if( $products->hasPages() )
{{ $products ->onEachSide(1) ->links() }}
@endif @else
No products found.
@endif @endif