@php /* * Public catalog only needs the compiled app CSS. * The project's Vite entry is resources/js/app.jsx, * not resources/css/app.css. */ $viteManifestPath = public_path( 'build/manifest.json' ); $catalogCssFiles = []; if ( is_file( $viteManifestPath ) ) { $viteManifest = json_decode( file_get_contents( $viteManifestPath ), true ); $catalogCssFiles = $viteManifest[ 'resources/js/app.jsx' ]['css'] ?? []; } @endphp @foreach( $catalogCssFiles as $catalogCssFile ) @endforeach @php $controller = app( \App\Modules\Catalog\Http\Controllers\PublicCatalogController::class ); $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 ); $specLabels = [ 'jewellery_type' => 'Jewellery Type', 'metal_type' => 'Metal', 'purity' => 'Purity / Karat', 'gross_weight_g' => 'Gross Weight', 'net_weight_g' => 'Net Weight', 'diamond_carat' => 'Diamond Carat', 'gemstone_carat' => 'Gemstone Carat', 'stone_count' => 'Stone Count', 'ring_size' => 'Size', 'length_cm' => 'Length', 'hallmark_huid' => 'Hallmark / HUID', 'certificate_no' => 'Certificate No.', 'making_charges' => 'Making Charges', 'gender' => 'Gender', 'occasion' => 'Occasion', ]; @endphp
← Back to Catalog
{{ $settings->title }}
@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( $hasSale && ! $priceOnRequest ) @if($currency === 'INR') ₹{{ number_format( (float) $product->regular_price, 2 ) }} @else {{ $currency }} {{ number_format( (float) $product->regular_price, 2 ) }} @endif @endif
@if($settings->show_stock)
@if( $product->availability === 'in_stock' ) ● In Stock @if($product->stock > 0) · {{ $product->stock }} available @endif @elseif( $product->availability === 'preorder' ) ● Preorder @else ● Out of Stock @endif
@endif @if($product->description)
{{ $product->description }}
@endif @if(count($attrs))

Product Specifications

@foreach( $specLabels as $key => $label ) @if( isset($attrs[$key]) && $attrs[$key] !== '' && $attrs[$key] !== false )
{{ $label }} {{ $attrs[$key] }} @if( in_array( $key, [ 'gross_weight_g', 'net_weight_g', ] ) ) g @elseif( in_array( $key, [ 'diamond_carat', 'gemstone_carat', ] ) ) ct @elseif( $key === 'length_cm' ) cm @endif
@endif @endforeach @foreach( $attrs['custom_attributes'] ?? [] as $attribute ) @if( !empty( $attribute['name'] ) && !empty( $attribute['value'] ) )
{{ $attribute['name'] }} {{ $attribute['value'] }}
@endif @endforeach
@endif @php $productWhatsappNumber = preg_replace( '/[^0-9]/', '', (string) ( $attrs['whatsapp_number'] ?? $settings->whatsapp_number ?? '' ) ); $waText = "Hi, I am interested in this product:\n\n" .$product->name; if ($product->sku) { $waText .= "\nSKU: " .$product->sku; } if ($priceOnRequest) { $waText .= "\nPrice: Please share the current price."; } else { $waText .= "\nPrice: " .$priceText; } $waText .= "\n\nProduct Link: " .route( 'public.catalog.product', [ 'slug' => $settings->slug, 'productSlug' => $product->slug, ] ); $waUrl = $productWhatsappNumber !== '' ? 'https://wa.me/' .$productWhatsappNumber .'?text=' .rawurlencode( $waText ) : null; @endphp @if($waUrl) {{ $priceOnRequest ? 'Ask Price on WhatsApp' : 'Send WhatsApp' }} @endif
@if($related->count())

Related Products

@foreach($related as $item) @php $relatedImage = $controller ->imageUrl( $item ); @endphp
@if($relatedImage) {{ $item->name }} @endif

{{ $item->name }}

@endforeach
@endif